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

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

Issue 2623753002: Native themes: Add separator color (Closed)
Patch Set: Created 3 years, 11 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
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/common_theme.h" 5 #include "ui/native_theme/common_theme.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "ui/base/material_design/material_design_controller.h" 10 #include "ui/base/material_design/material_design_controller.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 static const SkColor kSelectedMenuItemForegroundColor = SK_ColorBLACK; 69 static const SkColor kSelectedMenuItemForegroundColor = SK_ColorBLACK;
70 static const SkColor kDisabledMenuItemForegroundColor = 70 static const SkColor kDisabledMenuItemForegroundColor =
71 SkColorSetRGB(0xA1, 0xA1, 0x92); 71 SkColorSetRGB(0xA1, 0xA1, 0x92);
72 static const SkColor kMenuBorderColor = SkColorSetRGB(0xBA, 0xBA, 0xBA); 72 static const SkColor kMenuBorderColor = SkColorSetRGB(0xBA, 0xBA, 0xBA);
73 static const SkColor kEnabledMenuButtonBorderColor = 73 static const SkColor kEnabledMenuButtonBorderColor =
74 SkColorSetA(SK_ColorBLACK, 0x24); 74 SkColorSetA(SK_ColorBLACK, 0x24);
75 static const SkColor kFocusedMenuButtonBorderColor = 75 static const SkColor kFocusedMenuButtonBorderColor =
76 SkColorSetA(SK_ColorBLACK, 0x48); 76 SkColorSetA(SK_ColorBLACK, 0x48);
77 static const SkColor kMenuSeparatorColor = SkColorSetRGB(0xE9, 0xE9, 0xE9); 77 static const SkColor kMenuSeparatorColor = SkColorSetRGB(0xE9, 0xE9, 0xE9);
78 static const SkColor kEnabledMenuItemForegroundColor = SK_ColorBLACK; 78 static const SkColor kEnabledMenuItemForegroundColor = SK_ColorBLACK;
79 // Separator:
80 static const SkColor kSeparatorColor = SkColorSetRGB(0xE9, 0xE9, 0xE9);
79 // Link: 81 // Link:
80 static const SkColor kLinkEnabledColor = gfx::kGoogleBlue700; 82 static const SkColor kLinkEnabledColor = gfx::kGoogleBlue700;
81 // Text selection colors: 83 // Text selection colors:
82 static const SkColor kTextSelectionBackgroundFocused = 84 static const SkColor kTextSelectionBackgroundFocused =
83 SkColorSetARGB(0x54, 0x60, 0xA8, 0xEB); 85 SkColorSetARGB(0x54, 0x60, 0xA8, 0xEB);
84 static const SkColor kTextSelectionColor = color_utils::AlphaBlend( 86 static const SkColor kTextSelectionColor = color_utils::AlphaBlend(
85 SK_ColorBLACK, kTextSelectionBackgroundFocused, 0xdd); 87 SK_ColorBLACK, kTextSelectionBackgroundFocused, 0xdd);
86 // Textfield: 88 // Textfield:
87 static const SkColor kTextfieldDefaultColor = SK_ColorBLACK; 89 static const SkColor kTextfieldDefaultColor = SK_ColorBLACK;
88 static const SkColor kTextfieldDefaultBackground = SK_ColorWHITE; 90 static const SkColor kTextfieldDefaultBackground = SK_ColorWHITE;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 206
205 // Link 207 // Link
206 // TODO(estade): where, if anywhere, do we use disabled links in Chrome? 208 // TODO(estade): where, if anywhere, do we use disabled links in Chrome?
207 case NativeTheme::kColorId_LinkDisabled: 209 case NativeTheme::kColorId_LinkDisabled:
208 return SK_ColorBLACK; 210 return SK_ColorBLACK;
209 211
210 case NativeTheme::kColorId_LinkEnabled: 212 case NativeTheme::kColorId_LinkEnabled:
211 case NativeTheme::kColorId_LinkPressed: 213 case NativeTheme::kColorId_LinkPressed:
212 return kLinkEnabledColor; 214 return kLinkEnabledColor;
213 215
216 // Separator
217 case NativeTheme::kColorId_SeparatorColor:
218 return kSeparatorColor;
219
214 // Textfield 220 // Textfield
215 case NativeTheme::kColorId_TextfieldDefaultColor: 221 case NativeTheme::kColorId_TextfieldDefaultColor:
216 return kTextfieldDefaultColor; 222 return kTextfieldDefaultColor;
217 case NativeTheme::kColorId_TextfieldDefaultBackground: 223 case NativeTheme::kColorId_TextfieldDefaultBackground:
218 return kTextfieldDefaultBackground; 224 return kTextfieldDefaultBackground;
219 case NativeTheme::kColorId_TextfieldReadOnlyColor: 225 case NativeTheme::kColorId_TextfieldReadOnlyColor:
220 return kTextfieldReadOnlyColor; 226 return kTextfieldReadOnlyColor;
221 case NativeTheme::kColorId_TextfieldReadOnlyBackground: 227 case NativeTheme::kColorId_TextfieldReadOnlyBackground:
222 return kTextfieldReadOnlyBackground; 228 return kTextfieldReadOnlyBackground;
223 case NativeTheme::kColorId_TextfieldSelectionColor: 229 case NativeTheme::kColorId_TextfieldSelectionColor:
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 362 }
357 if (menu_item.corner_radius > 0) { 363 if (menu_item.corner_radius > 0) {
358 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); 364 const SkScalar radius = SkIntToScalar(menu_item.corner_radius);
359 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); 365 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint);
360 return; 366 return;
361 } 367 }
362 canvas->drawRect(gfx::RectToSkRect(rect), paint); 368 canvas->drawRect(gfx::RectToSkRect(rect), paint);
363 } 369 }
364 370
365 } // namespace ui 371 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698