Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 4c29e46

Browse files
committed
Merge pull request #251 from lincsoon/backport
Add gyp flag use_minimum_resources and exclude unnecessary resources
2 parents 24a582e + 21e79be commit 4c29e46

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

build/common.gypi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@
556556
# Enable web audio hrtf by default.
557557
'disable_webaudio_hrtf%': 0,
558558

559+
# Include all resources by default.
560+
'use_minimum_resources%': 0,
561+
559562
# Use native android functions in place of ICU. Not supported by most
560563
# components.
561564
'use_icu_alternatives_on_android%': 0,
@@ -1206,6 +1209,7 @@
12061209
'disable_file_support%': '<(disable_file_support)',
12071210
'disable_ftp_support%': '<(disable_ftp_support)',
12081211
'disable_webaudio_hrtf%': '<(disable_webaudio_hrtf)',
1212+
'use_minimum_resources%': '<(use_minimum_resources)',
12091213
'use_icu_alternatives_on_android%': '<(use_icu_alternatives_on_android)',
12101214
'enable_task_manager%': '<(enable_task_manager)',
12111215
'sas_dll_path%': '<(sas_dll_path)',
@@ -2147,6 +2151,9 @@
21472151
['disable_webaudio_hrtf==1', {
21482152
'grit_defines': ['-D', 'disable_webaudio_hrtf'],
21492153
}],
2154+
['use_minimum_resources==1', {
2155+
'grit_defines': ['-D', 'use_minimum_resources'],
2156+
}],
21502157
['enable_media_router==1', {
21512158
'grit_defines': ['-D', 'enable_media_router'],
21522159
}],
@@ -2978,6 +2985,9 @@
29782985
['disable_ftp_support==1', {
29792986
'defines': ['DISABLE_FTP_SUPPORT=1'],
29802987
}],
2988+
['use_minimum_resources==1', {
2989+
'defines': ['USE_MINIMUM_RESOURCES=1'],
2990+
}],
29812991
['enable_supervised_users==1', {
29822992
'defines': ['ENABLE_SUPERVISED_USERS=1'],
29832993
}],

content/child/blink_platform_impl.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ struct DataResource {
741741
const DataResource kDataResources[] = {
742742
{"missingImage", IDR_BROKENIMAGE, ui::SCALE_FACTOR_100P},
743743
{"missingImage@2x", IDR_BROKENIMAGE, ui::SCALE_FACTOR_200P},
744+
#if !defined(USE_MINIMUM_RESOURCES)
744745
{"mediaplayerPause", IDR_MEDIAPLAYER_PAUSE_BUTTON, ui::SCALE_FACTOR_100P},
745746
{"mediaplayerPauseHover",
746747
IDR_MEDIAPLAYER_PAUSE_BUTTON_HOVER,
@@ -854,6 +855,7 @@ const DataResource kDataResources[] = {
854855
{"mediaplayerOverlayPlay",
855856
IDR_MEDIAPLAYER_OVERLAY_PLAY_BUTTON,
856857
ui::SCALE_FACTOR_100P},
858+
#endif
857859
{"panIcon", IDR_PAN_SCROLL_ICON, ui::SCALE_FACTOR_100P},
858860
{"searchCancel", IDR_SEARCH_CANCEL, ui::SCALE_FACTOR_100P},
859861
{"searchCancelPressed", IDR_SEARCH_CANCEL_PRESSED, ui::SCALE_FACTOR_100P},

ui/resources/ui_resources.grd

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
</outputs>
1313
<release seq="1">
1414
<structures fallback_to_low_resolution="true">
15+
<structure type="chrome_scaled_image" name="IDR_MENU_CHECK_CHECKED" file="common/menu_check.png" />
16+
<structure type="chrome_scaled_image" name="IDR_MENU_DROPARROW" file="cros/menu_droparrow.png" />
17+
<if expr="use_aura or toolkit_views or (is_posix and not is_macosx and not is_ios)">
18+
<structure type="chrome_scaled_image" name="IDR_PROGRESS_BAR" file="linux/linux-progress-bar.png" />
19+
<structure type="chrome_scaled_image" name="IDR_PROGRESS_BORDER_LEFT" file="linux/linux-progress-border-left.png" />
20+
<structure type="chrome_scaled_image" name="IDR_PROGRESS_BORDER_RIGHT" file="linux/linux-progress-border-right.png" />
21+
<structure type="chrome_scaled_image" name="IDR_PROGRESS_VALUE" file="linux/linux-progress-value.png" />
22+
</if>
23+
<if expr="not pp_ifdef('use_minimum_resources')">
1524
<!-- KEEP THESE IN ALPHABETICAL ORDER! DO NOT ADD TO RANDOM PLACES JUST
1625
BECAUSE YOUR RESOURCES ARE FUNCTIONALLY RELATED OR FALL UNDER THE
1726
SAME CONDITIONALS. -->
@@ -305,7 +314,6 @@
305314
<if expr="is_macosx or is_ios">
306315
<structure type="chrome_scaled_image" name="IDR_MENU_HIERARCHY_ARROW" file="mac/menu_hierarchy_arrow.png" />
307316
</if>
308-
<structure type="chrome_scaled_image" name="IDR_MENU_CHECK_CHECKED" file="common/menu_check.png" />
309317
<if expr="toolkit_views">
310318
<structure type="chrome_scaled_image" name="IDR_MENU_CHECK" file="cros/menu_check.png" />
311319
<structure type="chrome_scaled_image" name="IDR_MENU_CHECK_CHECKED_DARK_BACKGROUND" file="common/menu_check_white.png" />
@@ -323,7 +331,6 @@
323331
<structure type="chrome_scaled_image" name="IDR_SLIDER_ACTIVE_THUMB" file="slider_thumb.png" />
324332
<structure type="chrome_scaled_image" name="IDR_SLIDER_DISABLED_THUMB" file="slider_thumb_disabled.png" />
325333
</if>
326-
<structure type="chrome_scaled_image" name="IDR_MENU_DROPARROW" file="cros/menu_droparrow.png" />
327334
<structure type="chrome_scaled_image" name="IDR_MESSAGE_CLOSE" file="common/message_close.png" />
328335
<if expr="desktop_linux">
329336
<structure type="chrome_scaled_image" name="IDR_MINIMIZE" file="linux/linux_minimize.png" />
@@ -386,12 +393,6 @@
386393
<structure type="chrome_scaled_image" name="IDR_PANEL_BOTTOM_LEFT_CORNER" file="panel_bottom_left_corner.png" />
387394
<structure type="chrome_scaled_image" name="IDR_PANEL_BOTTOM_RIGHT_CORNER" file="panel_bottom_right_corner.png" />
388395
</if>
389-
<if expr="use_aura or toolkit_views or (is_posix and not is_macosx and not is_ios)">
390-
<structure type="chrome_scaled_image" name="IDR_PROGRESS_BAR" file="linux/linux-progress-bar.png" />
391-
<structure type="chrome_scaled_image" name="IDR_PROGRESS_BORDER_LEFT" file="linux/linux-progress-border-left.png" />
392-
<structure type="chrome_scaled_image" name="IDR_PROGRESS_BORDER_RIGHT" file="linux/linux-progress-border-right.png" />
393-
<structure type="chrome_scaled_image" name="IDR_PROGRESS_VALUE" file="linux/linux-progress-value.png" />
394-
</if>
395396
<if expr="toolkit_views">
396397
<structure type="chrome_scaled_image" name="IDR_RADIO" file="common/radio.png" />
397398
<structure type="chrome_scaled_image" name="IDR_RADIO_CHECKED" file="common/radio_checked.png" />
@@ -594,6 +595,7 @@
594595
<structure type="chrome_scaled_image" name="IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_RIGHT" file="common/window_bubble_shadow_spike_small_right.png" />
595596
<structure type="chrome_scaled_image" name="IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_TOP" file="common/window_bubble_shadow_spike_small_top.png" />
596597
</if>
598+
</if>
597599
</structures>
598600
</release>
599601
</grit>

0 commit comments

Comments
 (0)