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

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

Issue 10384007: First stab at touch optimized omnibox auto-complete per sgabriel's mocks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. 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"
(...skipping 27 matching lines...) Expand all
38 const SkColor kLabelBackgroundColor = SK_ColorWHITE; 38 const SkColor kLabelBackgroundColor = SK_ColorWHITE;
39 // Textfield: 39 // Textfield:
40 const SkColor kTextfieldDefaultColor = SK_ColorBLACK; 40 const SkColor kTextfieldDefaultColor = SK_ColorBLACK;
41 const SkColor kTextfieldDefaultBackground = SK_ColorWHITE; 41 const SkColor kTextfieldDefaultBackground = SK_ColorWHITE;
42 const SkColor kTextfieldSelectionBackgroundFocused = 42 const SkColor kTextfieldSelectionBackgroundFocused =
43 SkColorSetARGB(0x54, 0x4D, 0x90, 0xFE); 43 SkColorSetARGB(0x54, 0x4D, 0x90, 0xFE);
44 const SkColor kTextfieldSelectionBackgroundUnfocused = SK_ColorLTGRAY; 44 const SkColor kTextfieldSelectionBackgroundUnfocused = SK_ColorLTGRAY;
45 const SkColor kTextfieldSelectionColor = 45 const SkColor kTextfieldSelectionColor =
46 color_utils::AlphaBlend(SK_ColorBLACK, 46 color_utils::AlphaBlend(SK_ColorBLACK,
47 kTextfieldSelectionBackgroundFocused, 0xdd); 47 kTextfieldSelectionBackgroundFocused, 0xdd);
48 // Colors for 3D controls:
49 const SkColor kThreeDLightShadow = SkColorSetRGB(0xE3, 0xE3, 0xE3);
50 const SkColor kThreeDShadow = SkColorSetRGB(0xA0, 0xA0, 0xA0);
48 51
49 } // namespace 52 } // namespace
50 53
51 namespace gfx { 54 namespace gfx {
52 55
53 // static 56 // static
54 const NativeTheme* NativeTheme::instance() { 57 const NativeTheme* NativeTheme::instance() {
55 return NativeThemeAura::instance(); 58 return NativeThemeAura::instance();
56 } 59 }
57 60
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 return kTextfieldDefaultColor; 119 return kTextfieldDefaultColor;
117 case kColorId_TextfieldDefaultBackground: 120 case kColorId_TextfieldDefaultBackground:
118 return kTextfieldDefaultBackground; 121 return kTextfieldDefaultBackground;
119 case kColorId_TextfieldSelectionColor: 122 case kColorId_TextfieldSelectionColor:
120 return kTextfieldSelectionColor; 123 return kTextfieldSelectionColor;
121 case kColorId_TextfieldSelectionBackgroundFocused: 124 case kColorId_TextfieldSelectionBackgroundFocused:
122 return kTextfieldSelectionBackgroundFocused; 125 return kTextfieldSelectionBackgroundFocused;
123 case kColorId_TextfieldSelectionBackgroundUnfocused: 126 case kColorId_TextfieldSelectionBackgroundUnfocused:
124 return kTextfieldSelectionBackgroundUnfocused; 127 return kTextfieldSelectionBackgroundUnfocused;
125 128
129 // Colors for 3D controls
130 case kColorId_ThreeDLightShadow:
131 return kThreeDLightShadow;
132 case kColorId_ThreeDShadow:
133 return kThreeDShadow;
134
126 default: 135 default:
127 NOTREACHED() << "Invalid color_id: " << color_id; 136 NOTREACHED() << "Invalid color_id: " << color_id;
128 break; 137 break;
129 } 138 }
130 139
131 return kInvalidColorIdColor; 140 return kInvalidColorIdColor;
132 } 141 }
133 142
134 void NativeThemeAura::PaintMenuPopupBackground(SkCanvas* canvas, 143 void NativeThemeAura::PaintMenuPopupBackground(SkCanvas* canvas,
135 const gfx::Size& size) const { 144 const gfx::Size& size) const {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 DrawTiledImage(canvas, *center, 292 DrawTiledImage(canvas, *center,
284 0, 0, 1.0, 1.0, 293 0, 0, 1.0, 1.0,
285 rect.x() + left->width(), rect.y(), 294 rect.x() + left->width(), rect.y(),
286 rect.width() - left->width() - right->width(), 295 rect.width() - left->width() - right->width(),
287 center->height()); 296 center->height());
288 } 297 }
289 } 298 }
290 } 299 }
291 300
292 } // namespace gfx 301 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698