| OLD | NEW |
| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 97 |
| 98 const ui::ThemeProvider* themeProvider = [window themeProvider]; | 98 const ui::ThemeProvider* themeProvider = [window themeProvider]; |
| 99 if (!themeProvider) | 99 if (!themeProvider) |
| 100 return [NSColor blackColor]; | 100 return [NSColor blackColor]; |
| 101 if (themeProvider->ShouldIncreaseContrast()) { |
| 102 if ([window hasDarkTheme]) |
| 103 return [NSColor whiteColor]; |
| 104 else |
| 105 return [NSColor blackColor]; |
| 106 } |
| 101 return themeProvider->GetNSColor( | 107 return themeProvider->GetNSColor( |
| 102 ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); | 108 ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); |
| 103 } | 109 } |
| 104 | 110 |
| 105 - (NSColor*)backgroundImageColor { | 111 - (NSColor*)backgroundImageColor { |
| 106 const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; | 112 const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; |
| 107 if (!themeProvider) | 113 if (!themeProvider) |
| 108 return [[self window] backgroundColor]; | 114 return [[self window] backgroundColor]; |
| 109 | 115 |
| 110 // Themes don't have an inactive image so only look for one if there's no | 116 // 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 Loading... |
| 173 | 179 |
| 174 - (void)windowDidChangeTheme { | 180 - (void)windowDidChangeTheme { |
| 175 [self setNeedsDisplay:YES]; | 181 [self setNeedsDisplay:YES]; |
| 176 } | 182 } |
| 177 | 183 |
| 178 - (void)windowDidChangeActive { | 184 - (void)windowDidChangeActive { |
| 179 [self setNeedsDisplay:YES]; | 185 [self setNeedsDisplay:YES]; |
| 180 } | 186 } |
| 181 | 187 |
| 182 @end | 188 @end |
| OLD | NEW |