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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm

Issue 1938243002: [Mac][Material Design] Correct location bar editing text colors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase from ToT. Created 4 years, 7 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/omnibox/omnibox_view_mac.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/location_bar/autocomplete_text_field_editor.h" 5 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.h"
6 6
7 #include "base/mac/sdk_forward_declarations.h" 7 #include "base/mac/sdk_forward_declarations.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" // IDC_* 10 #include "chrome/app/chrome_command_ids.h" // IDC_*
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 return self; 78 return self;
79 } 79 }
80 80
81 - (void)updateColorsToMatchTheme { 81 - (void)updateColorsToMatchTheme {
82 if (![[self window] inIncognitoMode]) { 82 if (![[self window] inIncognitoMode]) {
83 return; 83 return;
84 } 84 }
85 85
86 bool inDarkMode = [[self window] inIncognitoModeWithSystemTheme]; 86 bool inDarkMode = [[self window] inIncognitoModeWithSystemTheme];
87 // Draw a light insertion point for MD Incognito. 87 // Draw a white insertion point for MD Incognito.
88 NSColor* insertionPointColor = 88 NSColor* insertionPointColor =
89 inDarkMode ? [NSColor colorWithCalibratedWhite:1 alpha:0.75] 89 inDarkMode ? [NSColor whiteColor] : [NSColor blackColor];
90 : [NSColor blackColor];
91 [self setInsertionPointColor:insertionPointColor]; 90 [self setInsertionPointColor:insertionPointColor];
92 91
93 NSColor* textSelectionColor = [NSColor selectedTextBackgroundColor]; 92 NSColor* textSelectionColor = [NSColor selectedTextBackgroundColor];
94 if (inDarkMode) { 93 if (inDarkMode) {
95 // In MD Incognito the text is light gray against a dark background. When 94 // In MD Incognito the text is light gray against a dark background. When
96 // selected, the light gray text against the selection color is illegible. 95 // selected, the light gray text against the selection color is illegible.
97 // Rather than tweak or change the selection color, make the text black when 96 // Rather than tweak or change the selection color, make the text black when
98 // selected. 97 // selected.
99 [self setSelectedTextAttributes:@{ 98 [self setSelectedTextAttributes:@{
100 NSForegroundColorAttributeName : [NSColor blackColor], 99 NSForegroundColorAttributeName : [NSColor blackColor],
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 if (!ui::MaterialDesignController::IsModeMaterial()) { 608 if (!ui::MaterialDesignController::IsModeMaterial()) {
610 return; 609 return;
611 } 610 }
612 [self updateColorsToMatchTheme]; 611 [self updateColorsToMatchTheme];
613 } 612 }
614 613
615 - (void)windowDidChangeActive { 614 - (void)windowDidChangeActive {
616 } 615 }
617 616
618 @end 617 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698