OLD | NEW |
---|---|
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: | 56 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: |
57 return kSelectedMenuItemForegroundColorMd; | 57 return kSelectedMenuItemForegroundColorMd; |
58 // Link | 58 // Link |
59 case NativeTheme::kColorId_LinkDisabled: | 59 case NativeTheme::kColorId_LinkDisabled: |
60 return kLinkDisabledColorMd; | 60 return kLinkDisabledColorMd; |
61 case NativeTheme::kColorId_LinkEnabled: | 61 case NativeTheme::kColorId_LinkEnabled: |
62 case NativeTheme::kColorId_LinkPressed: | 62 case NativeTheme::kColorId_LinkPressed: |
63 // Normal and pressed share a color. | 63 // Normal and pressed share a color. |
64 return kLinkEnabledColorMd; | 64 return kLinkEnabledColorMd; |
65 | 65 |
66 // FocusableBorder | |
67 case NativeTheme::kColorId_FocusedBorderColor: | |
68 return gfx::kGoogleBlue500; | |
69 case NativeTheme::kColorId_UnfocusedBorderColor: | |
70 return SkColorSetA(SK_ColorBLACK, 0x66); | |
71 | |
66 // Results Tables | 72 // Results Tables |
67 case NativeTheme::kColorId_ResultsTableHoveredBackground: | 73 case NativeTheme::kColorId_ResultsTableHoveredBackground: |
68 return SkColorSetA(base_theme->GetSystemColor( | 74 return SkColorSetA(base_theme->GetSystemColor( |
69 NativeTheme::kColorId_ResultsTableNormalText), | 75 NativeTheme::kColorId_ResultsTableNormalText), |
70 0x0D); | 76 0x0D); |
71 case NativeTheme::kColorId_ResultsTableSelectedBackground: | 77 case NativeTheme::kColorId_ResultsTableSelectedBackground: |
72 return SkColorSetA(base_theme->GetSystemColor( | 78 return SkColorSetA(base_theme->GetSystemColor( |
73 NativeTheme::kColorId_ResultsTableNormalText), | 79 NativeTheme::kColorId_ResultsTableNormalText), |
74 0x14); | 80 0x14); |
75 case NativeTheme::kColorId_ResultsTableNormalText: | 81 case NativeTheme::kColorId_ResultsTableNormalText: |
(...skipping 18 matching lines...) Expand all Loading... | |
94 case NativeTheme::kColorId_ResultsTableNegativeText: | 100 case NativeTheme::kColorId_ResultsTableNegativeText: |
95 case NativeTheme::kColorId_ResultsTableNegativeHoveredText: | 101 case NativeTheme::kColorId_ResultsTableNegativeHoveredText: |
96 case NativeTheme::kColorId_ResultsTableNegativeSelectedText: | 102 case NativeTheme::kColorId_ResultsTableNegativeSelectedText: |
97 return kNegativeTextColorMd; | 103 return kNegativeTextColorMd; |
98 | 104 |
99 default: | 105 default: |
100 break; | 106 break; |
101 } | 107 } |
102 } | 108 } |
103 | 109 |
104 if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { | |
Evan Stade
2016/05/20 00:56:41
this change means that secondary ui surfaces which
| |
105 switch (color_id) { | |
106 // FocusableBorder | |
107 case NativeTheme::kColorId_FocusedBorderColor: | |
108 return gfx::kGoogleBlue500; | |
109 case NativeTheme::kColorId_UnfocusedBorderColor: | |
110 return SkColorSetA(SK_ColorBLACK, 0x66); | |
111 | |
112 default: | |
113 break; | |
114 } | |
115 } | |
116 | |
117 // Pre-MD colors. | 110 // Pre-MD colors. |
118 // Windows: | 111 // Windows: |
119 static const SkColor kWindowBackgroundColor = SK_ColorWHITE; | 112 static const SkColor kWindowBackgroundColor = SK_ColorWHITE; |
120 // Dialogs: | 113 // Dialogs: |
121 static const SkColor kDialogBackgroundColor = SkColorSetRGB(251, 251, 251); | 114 static const SkColor kDialogBackgroundColor = SkColorSetRGB(251, 251, 251); |
122 // FocusableBorder: | 115 // FocusableBorder: |
123 static const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); | 116 static const SkColor kFocusedBorderColor = SkColorSetRGB(0x4D, 0x90, 0xFE); |
124 static const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); | 117 static const SkColor kUnfocusedBorderColor = SkColorSetRGB(0xD9, 0xD9, 0xD9); |
125 // Button: | 118 // Button: |
126 static const SkColor kButtonBackgroundColor = SkColorSetRGB(0xDE, 0xDE, 0xDE); | 119 static const SkColor kButtonBackgroundColor = SkColorSetRGB(0xDE, 0xDE, 0xDE); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 } | 435 } |
443 if (menu_item.corner_radius > 0) { | 436 if (menu_item.corner_radius > 0) { |
444 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); | 437 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); |
445 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); | 438 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); |
446 return; | 439 return; |
447 } | 440 } |
448 canvas->drawRect(gfx::RectToSkRect(rect), paint); | 441 canvas->drawRect(gfx::RectToSkRect(rect), paint); |
449 } | 442 } |
450 | 443 |
451 } // namespace ui | 444 } // namespace ui |
OLD | NEW |