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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_view.mm

Issue 2719993004: cocoa: draw tabstrip stroke in white in increase-contrast incognito (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698