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

Side by Side Diff: chrome/browser/ui/cocoa/background_gradient_view.mm

Issue 2403853002: cocoa browser: remove remaining non-MD code (Closed)
Patch Set: git cl format Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/cocoa/background_gradient_view.h" 5 #include "chrome/browser/ui/cocoa/background_gradient_view.h"
6 6
7 #import "chrome/browser/themes/theme_properties.h" 7 #import "chrome/browser/themes/theme_properties.h"
8 #import "chrome/browser/themes/theme_service.h" 8 #import "chrome/browser/themes/theme_service.h"
9 #import "chrome/browser/ui/cocoa/themed_window.h" 9 #import "chrome/browser/ui/cocoa/themed_window.h"
10 #include "chrome/grit/theme_resources.h" 10 #include "chrome/grit/theme_resources.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 - (NSColor*)strokeColor { 87 - (NSColor*)strokeColor {
88 NSWindow* window = [self window]; 88 NSWindow* window = [self window];
89 89
90 // Some views have a child NSWindow between them and the window that is 90 // Some views have a child NSWindow between them and the window that is
91 // active (e.g, OmniboxPopupTopSeparatorView). For these, check the status 91 // active (e.g, OmniboxPopupTopSeparatorView). For these, check the status
92 // of parentWindow instead. Note that this is not tracked correctly (but 92 // of parentWindow instead. Note that this is not tracked correctly (but
93 // the views that do this appear to be removed when the window loses focus 93 // the views that do this appear to be removed when the window loses focus
94 // anyway). 94 // anyway).
95 if ([window parentWindow]) 95 if ([window parentWindow])
96 window = [window parentWindow]; 96 window = [window parentWindow];
97 BOOL isActive = [window isMainWindow];
98 97
99 const ui::ThemeProvider* themeProvider = [window themeProvider]; 98 const ui::ThemeProvider* themeProvider = [window themeProvider];
100 if (!themeProvider) 99 if (!themeProvider)
101 return [NSColor blackColor]; 100 return [NSColor blackColor];
102 if (!ui::MaterialDesignController::IsModeMaterial()) {
103 return themeProvider->GetNSColor(
104 isActive ? ThemeProperties::COLOR_TOOLBAR_STROKE :
105 ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE);
106 }
107 return themeProvider->GetNSColor( 101 return themeProvider->GetNSColor(
108 ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); 102 ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR);
109 } 103 }
110 104
111 - (NSColor*)backgroundImageColor { 105 - (NSColor*)backgroundImageColor {
112 const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; 106 const ui::ThemeProvider* themeProvider = [[self window] themeProvider];
113 if (!themeProvider) 107 if (!themeProvider)
114 return [[self window] backgroundColor]; 108 return [[self window] backgroundColor];
115 109
116 // Themes don't have an inactive image so only look for one if there's no 110 // Themes don't have an inactive image so only look for one if there's no
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 173
180 - (void)windowDidChangeTheme { 174 - (void)windowDidChangeTheme {
181 [self setNeedsDisplay:YES]; 175 [self setNeedsDisplay:YES];
182 } 176 }
183 177
184 - (void)windowDidChangeActive { 178 - (void)windowDidChangeActive {
185 [self setNeedsDisplay:YES]; 179 [self setNeedsDisplay:YES];
186 } 180 }
187 181
188 @end 182 @end
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service_mac.mm ('k') | chrome/browser/ui/cocoa/browser_window_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698