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

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

Issue 900613003: Mac: Make it easier for views to correctly draw with a theme. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gyp
Patch Set: Created 5 years, 11 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_strip_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
index e3ccd72c0400f6ebe53a3b3997ee416a560f2524..c2951e43063023eff957df07941a2126b7312e47 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
@@ -64,8 +64,8 @@
// Themes don't have an inactive image so only look for one if there's no
// theme.
- bool active = [[self window] isKeyWindow] || [[self window] isMainWindow] ||
- !themeProvider->UsingDefaultTheme();
+ bool active =
+ [[self window] isMainWindow] || !themeProvider->UsingDefaultTheme();
Andre 2015/02/03 19:20:37 I discussed this with Robert yesterday. The browse
int resource_id = active ? IDR_THEME_TOOLBAR : IDR_THEME_TOOLBAR_INACTIVE;
[themeProvider->GetNSImageColorNamed(resource_id) set];
NSRectFill(
@@ -81,7 +81,7 @@
borderRect.size.height = [image size].height;
borderRect.origin.y = 0;
- BOOL focused = [[self window] isKeyWindow] || [[self window] isMainWindow];
+ BOOL focused = [[self window] isMainWindow];
NSDrawThreePartImage(borderRect, nil, image, nil, /*vertical=*/ NO,
NSCompositeSourceOver,
focused ? 1.0 : tabs::kImageNoFocusAlpha,
@@ -296,4 +296,14 @@
controller_ = controller;
}
+// ThemedWindowDrawing implementation.
+
+- (void)windowDidChangeTheme {
+ [self setNeedsDisplay:YES];
+}
+
+- (void)windowDidChangeActive {
+ [self setNeedsDisplay:YES];
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698