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

Side by Side Diff: ui/native_theme/native_theme_mac.mm

Issue 2345183002: Views: Draw Textfield selected text in gray when top-level Widget loses focus.
Patch Set: Refactor to use SelectionController(Delegate). Unfinished! Created 4 years, 1 month 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 | « ui/native_theme/native_theme_dark_aura.cc ('k') | ui/native_theme/native_theme_win.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/native_theme/native_theme_mac.h" 5 #include "ui/native_theme/native_theme_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 // Text fields. 213 // Text fields.
214 case kColorId_TextfieldDefaultColor: 214 case kColorId_TextfieldDefaultColor:
215 case kColorId_TextfieldReadOnlyColor: 215 case kColorId_TextfieldReadOnlyColor:
216 return NSSystemColorToSkColor([NSColor textColor]); 216 return NSSystemColorToSkColor([NSColor textColor]);
217 case kColorId_TextfieldDefaultBackground: 217 case kColorId_TextfieldDefaultBackground:
218 case kColorId_TextfieldReadOnlyBackground: 218 case kColorId_TextfieldReadOnlyBackground:
219 return NSSystemColorToSkColor([NSColor textBackgroundColor]); 219 return NSSystemColorToSkColor([NSColor textBackgroundColor]);
220 case kColorId_TextfieldSelectionColor: 220 case kColorId_TextfieldSelectionColor:
221 return NSSystemColorToSkColor([NSColor selectedTextColor]); 221 return NSSystemColorToSkColor([NSColor selectedTextColor]);
222 case kColorId_TextfieldSelectionBackgroundUnfocused:
223 return kUnfocusedSelectedTextBackgroundColor;
222 224
223 // Trees/Tables. For focused text, use the alternate* versions, which 225 // Trees/Tables. For focused text, use the alternate* versions, which
224 // NSColor documents as "the table and list view equivalent to the 226 // NSColor documents as "the table and list view equivalent to the
225 // selectedControlTextColor". 227 // selectedControlTextColor".
226 case kColorId_TreeBackground: 228 case kColorId_TreeBackground:
227 case kColorId_TableBackground: 229 case kColorId_TableBackground:
228 return NSSystemColorToSkColor([NSColor controlBackgroundColor]); 230 return NSSystemColorToSkColor([NSColor controlBackgroundColor]);
229 case kColorId_TreeText: 231 case kColorId_TreeText:
230 case kColorId_TableText: 232 case kColorId_TableText:
231 case kColorId_TableSelectedTextUnfocused: 233 case kColorId_TableSelectedTextUnfocused:
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 canvas->drawDRRect(outer_shape, shape, paint); 436 canvas->drawDRRect(outer_shape, shape, paint);
435 } 437 }
436 438
437 NativeThemeMac::NativeThemeMac() { 439 NativeThemeMac::NativeThemeMac() {
438 } 440 }
439 441
440 NativeThemeMac::~NativeThemeMac() { 442 NativeThemeMac::~NativeThemeMac() {
441 } 443 }
442 444
443 } // namespace ui 445 } // namespace ui
OLDNEW
« no previous file with comments | « ui/native_theme/native_theme_dark_aura.cc ('k') | ui/native_theme/native_theme_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698