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

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: cleaned up 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
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..4f67940c3a737961b9866a8aca17f19e549482bc 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 use_active_tab_text_color = [self isActiveTab];
Robert Sesek 2016/07/12 23:43:56 naming: camelCase in ObjC
spqchan 2016/07/13 17:16:14 Done.
+
+ const SkColor titleColor =
+ use_active_tab_text_color
+ ? themeProvider->GetColor(ThemeProperties::COLOR_TAB_TEXT)
+ : themeProvider->GetColor(
+ ThemeProperties::COLOR_BACKGROUND_TAB_TEXT);
+ return SkColorSetA(titleColor, 0xA0);
+ }
+
+ return tabs::kDefaultTabTextColor;
}
- (void)accessibilityOptionsDidChange:(id)ignored {
« chrome/browser/ui/cocoa/tabs/tab_view.h ('K') | « 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