Skip to content

Commit

Permalink
Move IDR_PRODUCT_LOGO to //components
Browse files Browse the repository at this point in the history
The resource is moved to unblock the componentization
of version_ui. See https://codereview.chromium.org/1332353003/ for
context.

TBR=jochen

Review URL: https://codereview.chromium.org/1391923002

Cr-Commit-Position: refs/heads/master@{#353302}
  • Loading branch information
droger authored and Commit bot committed Oct 9, 2015
1 parent 04268f1 commit 2a6ab54
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 4 deletions.
2 changes: 0 additions & 2 deletions chrome/app/theme/theme_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -595,15 +595,13 @@
<structure type="chrome_scaled_image" name="IDR_PRINTER_NOTIFICATION" file="cros/printer_notification.png" />
</if>
<if expr="not _google_chrome">
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO" file="chromium/product_logo.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_16" file="chromium/product_logo_16.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_26" file="chromium/product_logo_26.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_32" file="chromium/product_logo_32.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_NAME_48" file="chromium/product_logo_name_48.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_WHITE" file="chromium/product_logo_white.png" />
</if>
<if expr="_google_chrome">
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO" file="google_chrome/product_logo.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_16" file="google_chrome/product_logo_16.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_26" file="google_chrome/product_logo_26.png" />
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO_32" file="google_chrome/product_logo_32.png" />
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ source_set("browser") {
"//components/password_manager/sync/browser",
"//components/plugins/common",
"//components/proxy_config",
"//components/resources",
"//components/safe_json",
"//components/sessions",
"//components/storage_monitor",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/resources/about_version.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<img src="chrome://theme/IDR_PRODUCT_LOGO">
</if>
<if expr="not enable_themes">
<img src="../../app/theme/default_100_percent/%DISTRIBUTION%/product_logo.png">
<img src="../../../components/resources/default_100_percent/%DISTRIBUTION%/product_logo.png">
</if>
<div id="company" i18n-content="company"></div>
<div id="copyright" i18n-content="copyright"></div>
Expand Down
5 changes: 5 additions & 0 deletions chrome/browser/resources_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
#include "grit/components_scaled_resources_map.h"
#include "grit/theme_resources_map.h"
#include "grit/ui_resources_map.h"

Expand All @@ -25,6 +26,10 @@ class ThemeMap {
typedef base::hash_map<std::string, int> StringIntMap;

ThemeMap() {
for (size_t i = 0; i < kComponentsScaledResourcesSize; ++i) {
id_map_[kComponentsScaledResources[i].name] =
kComponentsScaledResources[i].value;
}
for (size_t i = 0; i < kThemeResourcesSize; ++i)
id_map_[kThemeResources[i].name] = kThemeResources[i].value;
for (size_t i = 0; i < kUiResourcesSize; ++i)
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/themes/theme_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_set.h"
#include "grit/components_scaled_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/layout.h"
#include "ui/base/resource/material_design/material_design_controller.h"
Expand Down
2 changes: 2 additions & 0 deletions chrome/chrome_browser.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -3254,6 +3254,7 @@
'../components/components.gyp:web_cache_browser',
'../components/components.gyp:web_modal',
'../components/components.gyp:web_resource',
'../components/components_resources.gyp:components_resources',
'../content/app/resources/content_resources.gyp:content_resources',
'../device/devices_app/devices_app.gyp:device_usb_mojo_bindings_lib',
'../gpu/gpu.gyp:gpu',
Expand Down Expand Up @@ -3309,6 +3310,7 @@
'<@(chrome_browser_web_resource_sources)',

# These files are generated by GRIT.
'<(SHARED_INTERMEDIATE_DIR)/components/grit/components_scaled_resources_map.cc',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/grit/ui_resources_map.cc',
'<(grit_out_dir)/grit/component_extension_resources_map.cc',
'<(grit_out_dir)/grit/settings_resources_map.cc',
Expand Down
1 change: 1 addition & 0 deletions components/components_resources.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'dependencies': [
'about_credits',
],
'hard_dependency': 1,
'variables': {
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/components',
},
Expand Down
2 changes: 2 additions & 0 deletions components/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ grit("components_scaled_resources") {
output_name = "components_scaled_resources_new"
outputs = [
"grit/components_scaled_resources.h",
"grit/components_scaled_resources_map.cc",
"grit/components_scaled_resources_map.h",
"components_resources_100_percent.pak",
"components_resources_200_percent.pak",
"components_resources_300_percent.pak",
Expand Down
7 changes: 7 additions & 0 deletions components/resources/OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ per-file dom_distiller*=mdjones@chromium.org
per-file dom_distiller*=nyquist@chromium.org
per-file proximity_auth*=isherman@chromium.org
per-file proximity_auth*=tengs@chromium.org
per-file version_ui*=bauerb@chromium.org
per-file version_ui*=dbeam@chromium.org
per-file version_ui*=estade@chromium.org
per-file version_ui*=jhawkins@chromium.org
per-file version_ui*=nkostylev@chromium.org
per-file version_ui*=pam@chromium.org
per-file version_ui*=xiyuan@chromium.org
3 changes: 3 additions & 0 deletions components/resources/components_scaled_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<output filename="grit/components_scaled_resources.h" type="rc_header" context="default_100_percent">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/components_scaled_resources_map.cc" type="resource_map_source" context="default_100_percent" />
<output filename="grit/components_scaled_resources_map.h" type="resource_map_header" context="default_100_percent" />
<output filename="components_resources_100_percent.pak" type="data_package" context="default_100_percent" />
<output filename="components_resources_200_percent.pak" type="data_package" context="default_200_percent" />
<output filename="components_resources_300_percent.pak" type="data_package" context="default_300_percent" />
Expand All @@ -15,6 +17,7 @@
<part file="autofill_scaled_resources.grdp" />
<part file="crash_scaled_resources.grdp" />
<part file="omnibox_scaled_resources.grdp" />
<part file="version_ui_scaled_resources.grdp" />
</structures>
</release>
</grit>
9 changes: 9 additions & 0 deletions components/resources/version_ui_scaled_resources.grdp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<if expr="not _google_chrome">
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO" file="chromium/product_logo.png" />
</if>
<if expr="_google_chrome">
<structure type="chrome_scaled_image" name="IDR_PRODUCT_LOGO" file="google_chrome/product_logo.png" />
</if>
</grit-part>
2 changes: 1 addition & 1 deletion tools/gritsettings/resource_ids
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
"includes": [30175],
},
"components/resources/components_scaled_resources.grd": {
"structures": [30350],
"structures": [30345],
},
"third_party/WebKit/public/blink_resources.grd": {
"includes": [30370],
Expand Down

0 comments on commit 2a6ab54

Please sign in to comment.