Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm

Issue 1987053005: [Mac][Material Design] Fix toolbar icon hover bg for custom themes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm b/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
index f01208a98bb01c9ff074289f7d4f0d0cc4fc32f4..998748fe9f56facf1a97087ea7c7ffffdd329583 100644
--- a/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
+++ b/chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm
@@ -294,6 +294,7 @@ const NSSize kMDButtonIconSize = NSMakeSize(16, 16);
NSImage* normalIcon = nil;
NSImage* disabledIcon = nil;
+ BOOL isDarkTheme = NO;
gfx::VectorIconId iconId = [self vectorIconId];
if (iconId == gfx::VectorIconId::VECTOR_ICON_NONE) {
@@ -309,7 +310,7 @@ const NSSize kMDButtonIconSize = NSMakeSize(16, 16);
normalIcon = disabledIcon = defaultImage;
} else {
// Compute the normal and disabled vector icon colors.
- BOOL isDarkTheme = [[self window] hasDarkTheme];
+ isDarkTheme = [[self window] hasDarkTheme];
const SkColor vectorIconColor = [self vectorIconColor:isDarkTheme];
CGFloat normalAlpha = isDarkTheme ? 0xCC : 0xFF;
const SkColor normalColor = SkColorSetA(vectorIconColor, normalAlpha);
@@ -350,8 +351,7 @@ const NSSize kMDButtonIconSize = NSMakeSize(16, 16);
// Use the themed style for custom themes and Incognito mode.
const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
bool incongitoMode = themeProvider && themeProvider->InIncognitoMode();
- bool usingACustomTheme = themeProvider && !themeProvider->UsingSystemTheme();
- if (usingACustomTheme || incongitoMode) {
+ if (isDarkTheme || incongitoMode) {
hoverStyle = ToolbarButtonImageBackgroundStyle::HOVER_THEMED;
pressedStyle = ToolbarButtonImageBackgroundStyle::PRESSED_THEMED;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698