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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_view.mm

Issue 2126043002: [Material][Mac] Fix Default Favicon's Color (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for rsesek 2 Created 4 years, 5 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 | « chrome/browser/ui/cocoa/tabs/tab_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm
index 20e3e2173a4011ab528aa04c185f6045c9b310dd..06ee80125a5d030b5a9f4b6185cc7aa830e68eee 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -27,6 +27,12 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
+namespace {
+
+// The color of the icons in dark mode theme.
+const SkColor kDarkModeIconColor = SkColorSetARGB(0xFF, 0xC4, 0xC4, 0xC4);
+
+} // namespace
// The amount of time in seconds during which each type of glow increases, holds
// steady, and decreases, respectively.
@@ -631,8 +637,23 @@ CGFloat LineWidthFromContext(CGContextRef context) {
[self setNeedsDisplayInRect:[titleView_ frame]];
}
-- (SkColor)closeButtonColor {
- return [[controller_ closeButton] iconColor];
+- (SkColor)iconColor {
+ if ([[self window] hasDarkTheme])
+ return kDarkModeIconColor;
+
+ const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
+ if (themeProvider) {
+ bool useActiveTabTextColor = [self isActiveTab];
+
+ const SkColor titleColor =
+ useActiveTabTextColor
+ ? themeProvider->GetColor(ThemeProperties::COLOR_TAB_TEXT)
+ : themeProvider->GetColor(
+ ThemeProperties::COLOR_BACKGROUND_TAB_TEXT);
+ return SkColorSetA(titleColor, 0xA0);
+ }
+
+ return tabs::kDefaultTabTextColor;
}
- (void)accessibilityOptionsDidChange:(id)ignored {
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698