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

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

Issue 2623753002: Native themes: Add separator color (Closed)
Patch Set: Change function order 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
« no previous file with comments | « chrome/browser/ui/libgtkui/native_theme_gtk3.cc ('k') | ui/native_theme/native_theme.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) 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 202
201 // Link 203 // Link
202 // TODO(estade): where, if anywhere, do we use disabled links in Chrome? 204 // TODO(estade): where, if anywhere, do we use disabled links in Chrome?
203 case NativeTheme::kColorId_LinkDisabled: 205 case NativeTheme::kColorId_LinkDisabled:
204 return SK_ColorBLACK; 206 return SK_ColorBLACK;
205 207
206 case NativeTheme::kColorId_LinkEnabled: 208 case NativeTheme::kColorId_LinkEnabled:
207 case NativeTheme::kColorId_LinkPressed: 209 case NativeTheme::kColorId_LinkPressed:
208 return kLinkEnabledColor; 210 return kLinkEnabledColor;
209 211
212 // Separator
213 case NativeTheme::kColorId_SeparatorColor:
214 return kSeparatorColor;
215
210 // Textfield 216 // Textfield
211 case NativeTheme::kColorId_TextfieldDefaultColor: 217 case NativeTheme::kColorId_TextfieldDefaultColor:
212 return kTextfieldDefaultColor; 218 return kTextfieldDefaultColor;
213 case NativeTheme::kColorId_TextfieldDefaultBackground: 219 case NativeTheme::kColorId_TextfieldDefaultBackground:
214 return kTextfieldDefaultBackground; 220 return kTextfieldDefaultBackground;
215 case NativeTheme::kColorId_TextfieldReadOnlyColor: 221 case NativeTheme::kColorId_TextfieldReadOnlyColor:
216 return kTextfieldReadOnlyColor; 222 return kTextfieldReadOnlyColor;
217 case NativeTheme::kColorId_TextfieldReadOnlyBackground: 223 case NativeTheme::kColorId_TextfieldReadOnlyBackground:
218 return kTextfieldReadOnlyBackground; 224 return kTextfieldReadOnlyBackground;
219 case NativeTheme::kColorId_TextfieldSelectionColor: 225 case NativeTheme::kColorId_TextfieldSelectionColor:
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 350 }
345 if (menu_item.corner_radius > 0) { 351 if (menu_item.corner_radius > 0) {
346 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); 352 const SkScalar radius = SkIntToScalar(menu_item.corner_radius);
347 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); 353 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint);
348 return; 354 return;
349 } 355 }
350 canvas->drawRect(gfx::RectToSkRect(rect), paint); 356 canvas->drawRect(gfx::RectToSkRect(rect), paint);
351 } 357 }
352 358
353 } // namespace ui 359 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtkui/native_theme_gtk3.cc ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698