Commit c306fb9a authored by andresantoso's avatar andresantoso Committed by Commit bot

MacViews: Fix missing browser assets

The MacViews browser were missing infobar and background tab assets.
mac_views_browser grit define is added so that we can include infobar assets.
Don't remap theme image ids so that Mac's background tab assets can be
found.
Map IDR_THEME_TAB_BACKGROUND_INCOGNITO to the same asset as
IDR_THEME_TAB_BACKGROUND.

BUG=425229

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

Cr-Commit-Position: refs/heads/master@{#321602}
parent 8dbee052
......@@ -647,6 +647,9 @@
# See http://clang.llvm.org/docs/ControlFlowIntegrity.html
'cfi_vptr%': 0,
# Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
'mac_views_browser%': 0,
'conditions': [
# A flag for POSIX platforms
['OS=="win"', {
......@@ -1214,6 +1217,7 @@
'video_hole%': '<(video_hole)',
'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
'cfi_vptr%': '<(cfi_vptr)',
'mac_views_browser%': '<(mac_views_browser)',
# Use system protobuf instead of bundled one.
'use_system_protobuf%': 0,
......@@ -1499,9 +1503,6 @@
'ozone_platform_ozonex%': 0,
'ozone_platform_test%': 0,
# Whether the browser is non-native (using Views Toolkit) on Mac.
'mac_views_browser%': 0,
# Experiment: http://crbug.com/426914
'envoy%': 0,
......@@ -2154,6 +2155,9 @@
['enable_wifi_bootstrapping==1', {
'grit_defines': ['-D', 'enable_wifi_bootstrapping'],
}],
['mac_views_browser==1', {
'grit_defines': ['-D', 'mac_views_browser'],
}],
['enable_resource_whitelist_generation==1 and OS!="win"', {
'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
}],
......
......@@ -30,6 +30,9 @@ declare_args() {
# True means the UI is built using the "views" framework.
toolkit_views = is_mac || is_win || is_chromeos || use_aura
# Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
mac_views_browser = false
# Whether we should use glib, a low level C utility library.
use_glib = is_linux && !use_ozone
}
......
......@@ -285,6 +285,12 @@ if (enable_service_discovery) {
"enable_service_discovery",
]
}
if (mac_views_browser) {
grit_defines += [
"-D",
"mac_views_browser",
]
}
grit_resource_id_file = "//tools/gritsettings/resource_ids"
grit_info_script = "//tools/grit/grit_info.py"
......
......@@ -366,7 +366,7 @@
<structure type="chrome_scaled_image" name="IDR_ICON_POWER_WHITE" file="cros/icon_power_white.png" />
</if>
<structure type="chrome_scaled_image" name="IDR_INFO" file="common/info_small.png" />
<if expr="toolkit_views and not is_macosx">
<if expr="(toolkit_views and not is_macosx) or mac_views_browser">
<structure type="chrome_scaled_image" name="IDR_INFOBARBUTTON_HOVER_BOTTOM" file="common/infobarbutton_bottom_hover.png" />
<structure type="chrome_scaled_image" name="IDR_INFOBARBUTTON_HOVER_BOTTOM_LEFT" file="common/infobarbutton_bottom_left_hover.png" />
<structure type="chrome_scaled_image" name="IDR_INFOBARBUTTON_HOVER_BOTTOM_RIGHT" file="common/infobarbutton_bottom_right_hover.png" />
......@@ -956,6 +956,9 @@
<if expr="is_macosx or is_ios">
<structure type="chrome_scaled_image" name="IDR_THEME_TAB_BACKGROUND" file="mac/theme_default_inactive.png" />
<structure type="chrome_scaled_image" name="IDR_THEME_TAB_BACKGROUND_INACTIVE" file="mac/theme_default_inactive_background.png" />
<if expr="mac_views_browser">
<structure type="chrome_scaled_image" name="IDR_THEME_TAB_BACKGROUND_INCOGNITO" file="mac/theme_default_inactive.png" />
</if>
</if>
<structure type="chrome_scaled_image" name="IDR_THEME_TAB_BACKGROUND_V" file="theme_tab_background_glass.png" />
<if expr="not use_ash and not is_macosx and not is_ios">
......
......@@ -8,8 +8,10 @@
namespace chrome {
// On platforms where there is both Ash and a desktop browser, provide DESKTOP
// resources for the latter.
int MapThemeImage(HostDesktopType desktop_type, int resource) {
#if !defined(OS_CHROMEOS)
#if !defined(OS_CHROMEOS) && !defined(OS_MACOSX)
if (desktop_type != HOST_DESKTOP_TYPE_NATIVE)
return resource;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment