| 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 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 6 | 6 |
| 7 #include <cmath> // floor | 7 #include <cmath> // floor |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if ([window isMainWindow]) { | 78 if ([window isMainWindow]) { |
| 79 strokeColor = themeProvider->GetNSColor( | 79 strokeColor = themeProvider->GetNSColor( |
| 80 ThemeProperties::COLOR_TOOLBAR_STROKE_THEME); | 80 ThemeProperties::COLOR_TOOLBAR_STROKE_THEME); |
| 81 } else { | 81 } else { |
| 82 strokeColor = themeProvider->GetNSColor( | 82 strokeColor = themeProvider->GetNSColor( |
| 83 ThemeProperties::COLOR_TOOLBAR_STROKE_THEME_INACTIVE); | 83 ThemeProperties::COLOR_TOOLBAR_STROKE_THEME_INACTIVE); |
| 84 } | 84 } |
| 85 } else { | 85 } else { |
| 86 strokeColor = | 86 strokeColor = |
| 87 themeProvider->GetNSColor(ThemeProperties::COLOR_TOOLBAR_STROKE); | 87 themeProvider->GetNSColor(ThemeProperties::COLOR_TOOLBAR_STROKE); |
| 88 |
| 89 // If the current theme is the system theme, and the system is in "increase |
| 90 // contrast" mode, and this is an incognito window, force the toolbar stroke |
| 91 // to be drawn in white instead of black, to make it show up better. |
| 92 if ([[self window] hasDarkTheme] && themeProvider->ShouldIncreaseContrast()) |
| 93 strokeColor = [NSColor whiteColor]; |
| 88 } | 94 } |
| 89 | 95 |
| 90 if (themeProvider->ShouldIncreaseContrast()) | 96 if (themeProvider->ShouldIncreaseContrast()) |
| 91 strokeColor = [strokeColor colorWithAlphaComponent:100]; | 97 strokeColor = [strokeColor colorWithAlphaComponent:100]; |
| 92 [strokeColor set]; | 98 [strokeColor set]; |
| 93 | 99 |
| 94 NSRect borderRect = NSMakeRect(0.0, 0.0, self.bounds.size.width, | 100 NSRect borderRect = NSMakeRect(0.0, 0.0, self.bounds.size.width, |
| 95 [self cr_lineWidth]); | 101 [self cr_lineWidth]); |
| 96 NSRectFillUsingOperation(NSIntersectionRect(dirtyRect, borderRect), | 102 NSRectFillUsingOperation(NSIntersectionRect(dirtyRect, borderRect), |
| 97 NSCompositeSourceOver); | 103 NSCompositeSourceOver); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if (visualEffectsDisabledForFullscreen_ || | 428 if (visualEffectsDisabledForFullscreen_ || |
| 423 themeProvider->HasCustomImage(IDR_THEME_FRAME) || | 429 themeProvider->HasCustomImage(IDR_THEME_FRAME) || |
| 424 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { | 430 themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) { |
| 425 [visualEffectView setState:NSVisualEffectStateInactive]; | 431 [visualEffectView setState:NSVisualEffectStateInactive]; |
| 426 } else { | 432 } else { |
| 427 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; | 433 [visualEffectView setState:NSVisualEffectStateFollowsWindowActiveState]; |
| 428 } | 434 } |
| 429 } | 435 } |
| 430 | 436 |
| 431 @end | 437 @end |
| OLD | NEW |