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

Side by Side Diff: ui/native_theme/native_theme_aura.cc

Issue 11421204: Use native theme colors for textfields; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nix cursor color; adjust textfield functions; add read-only theme colors. Created 8 years 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 | Annotate | Revision Log
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 #include "ui/native_theme/native_theme_aura.h" 5 #include "ui/native_theme/native_theme_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "ui/base/layout.h" 9 #include "ui/base/layout.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 23 matching lines...) Expand all
34 const SkColor kEnabledMenuItemForegroundColor = kTextButtonEnabledColor; 34 const SkColor kEnabledMenuItemForegroundColor = kTextButtonEnabledColor;
35 const SkColor kDisabledMenuItemForegroundColor = kTextButtonDisabledColor; 35 const SkColor kDisabledMenuItemForegroundColor = kTextButtonDisabledColor;
36 const SkColor kFocusedMenuItemBackgroundColor = SkColorSetRGB(0xF1, 0xF1, 0xF1); 36 const SkColor kFocusedMenuItemBackgroundColor = SkColorSetRGB(0xF1, 0xF1, 0xF1);
37 const SkColor kMenuSeparatorColor = SkColorSetRGB(0xED, 0xED, 0xED); 37 const SkColor kMenuSeparatorColor = SkColorSetRGB(0xED, 0xED, 0xED);
38 // Label: 38 // Label:
39 const SkColor kLabelEnabledColor = kTextButtonEnabledColor; 39 const SkColor kLabelEnabledColor = kTextButtonEnabledColor;
40 const SkColor kLabelDisabledColor = kTextButtonDisabledColor; 40 const SkColor kLabelDisabledColor = kTextButtonDisabledColor;
41 const SkColor kLabelBackgroundColor = SK_ColorWHITE; 41 const SkColor kLabelBackgroundColor = SK_ColorWHITE;
42 // Textfield: 42 // Textfield:
43 const SkColor kTextfieldDefaultColor = SK_ColorBLACK; 43 const SkColor kTextfieldDefaultColor = SK_ColorBLACK;
44 const SkColor kTextfieldDefaultBackground = SK_ColorWHITE; 44 const SkColor kTextfieldDefaultBackground = SK_ColorWHITE;
varunjain 2012/12/04 23:05:31 this one
msw 2012/12/05 02:09:56 I in-lined the CrOS case into GetColor, as explain
45 const SkColor kTextfieldReadOnlyColor = SK_ColorDKGRAY;
46 const SkColor kTextfieldReadOnlyBackground = SK_ColorWHITE;
45 const SkColor kTextfieldSelectionBackgroundFocused = 47 const SkColor kTextfieldSelectionBackgroundFocused =
46 SkColorSetARGB(0x54, 0x60, 0xA8, 0xEB); 48 SkColorSetARGB(0x54, 0x60, 0xA8, 0xEB);
47 const SkColor kTextfieldSelectionBackgroundUnfocused = SK_ColorLTGRAY; 49 const SkColor kTextfieldSelectionBackgroundUnfocused = SK_ColorLTGRAY;
48 const SkColor kTextfieldSelectionColor = 50 const SkColor kTextfieldSelectionColor =
49 color_utils::AlphaBlend(SK_ColorBLACK, 51 color_utils::AlphaBlend(SK_ColorBLACK,
50 kTextfieldSelectionBackgroundFocused, 0xdd); 52 kTextfieldSelectionBackgroundFocused, 0xdd);
51 53
52 } // namespace 54 } // namespace
53 55
54 namespace ui { 56 namespace ui {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 case kColorId_LabelDisabledColor: 116 case kColorId_LabelDisabledColor:
115 return kLabelDisabledColor; 117 return kLabelDisabledColor;
116 case kColorId_LabelBackgroundColor: 118 case kColorId_LabelBackgroundColor:
117 return kLabelBackgroundColor; 119 return kLabelBackgroundColor;
118 120
119 // Textfield 121 // Textfield
120 case kColorId_TextfieldDefaultColor: 122 case kColorId_TextfieldDefaultColor:
121 return kTextfieldDefaultColor; 123 return kTextfieldDefaultColor;
122 case kColorId_TextfieldDefaultBackground: 124 case kColorId_TextfieldDefaultBackground:
123 return kTextfieldDefaultBackground; 125 return kTextfieldDefaultBackground;
126 case kColorId_TextfieldReadOnlyColor:
127 return kTextfieldReadOnlyColor;
128 case kColorId_TextfieldReadOnlyBackground:
129 return kTextfieldReadOnlyBackground;
124 case kColorId_TextfieldSelectionColor: 130 case kColorId_TextfieldSelectionColor:
125 return kTextfieldSelectionColor; 131 return kTextfieldSelectionColor;
126 case kColorId_TextfieldSelectionBackgroundFocused: 132 case kColorId_TextfieldSelectionBackgroundFocused:
127 return kTextfieldSelectionBackgroundFocused; 133 return kTextfieldSelectionBackgroundFocused;
128 case kColorId_TextfieldSelectionBackgroundUnfocused: 134 case kColorId_TextfieldSelectionBackgroundUnfocused:
129 return kTextfieldSelectionBackgroundUnfocused; 135 return kTextfieldSelectionBackgroundUnfocused;
130 136
131 default: 137 default:
132 NOTREACHED() << "Invalid color_id: " << color_id; 138 NOTREACHED() << "Invalid color_id: " << color_id;
133 break; 139 break;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 DrawTiledImage(canvas, *center, 293 DrawTiledImage(canvas, *center,
288 0, 0, 1.0, 1.0, 294 0, 0, 1.0, 1.0,
289 rect.x() + left->width(), rect.y(), 295 rect.x() + left->width(), rect.y(),
290 rect.width() - left->width() - right->width(), 296 rect.width() - left->width() - right->width(),
291 center->height()); 297 center->height());
292 } 298 }
293 } 299 }
294 } 300 }
295 301
296 } // namespace ui 302 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698