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

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

Issue 10270021: Make all the menu UI consitent with the new chromeos menu spec. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | 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/gfx/native_theme_aura.h" 5 #include "ui/gfx/native_theme_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "grit/gfx_resources.h" 8 #include "grit/gfx_resources.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
11 #include "ui/gfx/size.h" 11 #include "ui/gfx/size.h"
12 #include "ui/gfx/skbitmap_operations.h" 12 #include "ui/gfx/skbitmap_operations.h"
13 13
14 namespace { 14 namespace {
15 15
16 const SkColor kMenuBackgroundColor = SK_ColorWHITE; 16 const SkColor kMenuBackgroundColor = SK_ColorWHITE;
17 17
18 // Theme colors returned by GetSystemColor(). 18 // Theme colors returned by GetSystemColor().
19 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128); 19 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128);
20 // Dialogs: 20 // Dialogs:
21 const SkColor kDialogBackgroundColor = SK_ColorWHITE; 21 const SkColor kDialogBackgroundColor = SK_ColorWHITE;
22 // FocusableBorder: 22 // FocusableBorder:
23 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); 23 const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE);
24 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); 24 const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9);
25 // TextButton: 25 // TextButton:
26 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xDE, 0xDE, 0xDE); 26 const SkColor kTextButtonBackgroundColor = SkColorSetRGB(0xDE, 0xDE, 0xDE);
27 const SkColor kTextButtonEnabledColor = SkColorSetRGB(0x44, 0x44, 0x44); 27 const SkColor kTextButtonEnabledColor = SkColorSetRGB(0x22, 0x22, 0x22);
28 const SkColor kTextButtonDisabledColor = SkColorSetRGB(0x99, 0x99, 0x99); 28 const SkColor kTextButtonDisabledColor = SkColorSetRGB(0x99, 0x99, 0x99);
29 const SkColor kTextButtonHighlightColor = SkColorSetRGB(0, 0, 0); 29 const SkColor kTextButtonHighlightColor = SkColorSetRGB(0, 0, 0);
30 const SkColor kTextButtonHoverColor = kTextButtonEnabledColor; 30 const SkColor kTextButtonHoverColor = kTextButtonEnabledColor;
31 // MenuItem: 31 // MenuItem:
32 const SkColor kEnabledMenuItemForegroundColor = SK_ColorBLACK; 32 const SkColor kEnabledMenuItemForegroundColor = kTextButtonEnabledColor;
33 const SkColor kDisabledMenuItemForegroundColor = 33 const SkColor kDisabledMenuItemForegroundColor = kTextButtonDisabledColor;
34 SkColorSetRGB(0x80, 0x80, 0x80);
35 const SkColor kFocusedMenuItemBackgroundColor = SkColorSetRGB(0xF1, 0xF1, 0xF1); 34 const SkColor kFocusedMenuItemBackgroundColor = SkColorSetRGB(0xF1, 0xF1, 0xF1);
35 // Label:
36 const SkColor kLabelEnabledColor = kTextButtonEnabledColor;
37 const SkColor kLabelDisabledColor = kTextButtonDisabledColor;
38 const SkColor kLabelBackgroundColor = SK_ColorWHITE;
36 // Textfield: 39 // Textfield:
37 const SkColor kTextfieldDefaultColor = SK_ColorBLACK; 40 const SkColor kTextfieldDefaultColor = SK_ColorBLACK;
38 const SkColor kTextfieldDefaultBackground = SK_ColorWHITE; 41 const SkColor kTextfieldDefaultBackground = SK_ColorWHITE;
39 const SkColor kTextfieldSelectionBackgroundFocused = 42 const SkColor kTextfieldSelectionBackgroundFocused =
40 SkColorSetARGB(0x54, 0x4D, 0x90, 0xFE); 43 SkColorSetARGB(0x54, 0x4D, 0x90, 0xFE);
41 const SkColor kTextfieldSelectionBackgroundUnfocused = SK_ColorLTGRAY; 44 const SkColor kTextfieldSelectionBackgroundUnfocused = SK_ColorLTGRAY;
42 const SkColor kTextfieldSelectionColor = 45 const SkColor kTextfieldSelectionColor =
43 color_utils::AlphaBlend(SK_ColorBLACK, 46 color_utils::AlphaBlend(SK_ColorBLACK,
44 kTextfieldSelectionBackgroundFocused, 0xdd); 47 kTextfieldSelectionBackgroundFocused, 0xdd);
45 48
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return kTextButtonHoverColor; 96 return kTextButtonHoverColor;
94 97
95 // MenuItem 98 // MenuItem
96 case kColorId_EnabledMenuItemForegroundColor: 99 case kColorId_EnabledMenuItemForegroundColor:
97 return kEnabledMenuItemForegroundColor; 100 return kEnabledMenuItemForegroundColor;
98 case kColorId_DisabledMenuItemForegroundColor: 101 case kColorId_DisabledMenuItemForegroundColor:
99 return kDisabledMenuItemForegroundColor; 102 return kDisabledMenuItemForegroundColor;
100 case kColorId_FocusedMenuItemBackgroundColor: 103 case kColorId_FocusedMenuItemBackgroundColor:
101 return kFocusedMenuItemBackgroundColor; 104 return kFocusedMenuItemBackgroundColor;
102 105
106 // Label
107 case kColorId_LabelEnabledColor:
108 return kLabelEnabledColor;
109 case kColorId_LabelDisabledColor:
110 return kLabelDisabledColor;
111 case kColorId_LabelBackgroundColor:
112 return kLabelBackgroundColor;
113
103 // Textfield 114 // Textfield
104 case kColorId_TextfieldDefaultColor: 115 case kColorId_TextfieldDefaultColor:
105 return kTextfieldDefaultColor; 116 return kTextfieldDefaultColor;
106 case kColorId_TextfieldDefaultBackground: 117 case kColorId_TextfieldDefaultBackground:
107 return kTextfieldDefaultBackground; 118 return kTextfieldDefaultBackground;
108 case kColorId_TextfieldSelectionColor: 119 case kColorId_TextfieldSelectionColor:
109 return kTextfieldSelectionColor; 120 return kTextfieldSelectionColor;
110 case kColorId_TextfieldSelectionBackgroundFocused: 121 case kColorId_TextfieldSelectionBackgroundFocused:
111 return kTextfieldSelectionBackgroundFocused; 122 return kTextfieldSelectionBackgroundFocused;
112 case kColorId_TextfieldSelectionBackgroundUnfocused: 123 case kColorId_TextfieldSelectionBackgroundUnfocused:
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 DrawTiledImage(canvas, *center, 283 DrawTiledImage(canvas, *center,
273 0, 0, 1.0, 1.0, 284 0, 0, 1.0, 1.0,
274 rect.x() + left->width(), rect.y(), 285 rect.x() + left->width(), rect.y(),
275 rect.width() - left->width() - right->width(), 286 rect.width() - left->width() - right->width(),
276 center->height()); 287 center->height());
277 } 288 }
278 } 289 }
279 } 290 }
280 291
281 } // namespace gfx 292 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698