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

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

Issue 2961223002: Rename native theme color constants relating to text on dialog buttons
Patch Set: rebase Created 3 years, 5 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 static const SkColor kThrobberLightColor = SkColorSetRGB(0xF4, 0xF8, 0xFD); 132 static const SkColor kThrobberLightColor = SkColorSetRGB(0xF4, 0xF8, 0xFD);
133 133
134 switch (color_id) { 134 switch (color_id) {
135 // Dialogs 135 // Dialogs
136 case NativeTheme::kColorId_WindowBackground: 136 case NativeTheme::kColorId_WindowBackground:
137 case NativeTheme::kColorId_DialogBackground: 137 case NativeTheme::kColorId_DialogBackground:
138 case NativeTheme::kColorId_BubbleBackground: 138 case NativeTheme::kColorId_BubbleBackground:
139 return kDialogBackgroundColor; 139 return kDialogBackgroundColor;
140 140
141 // Buttons 141 // Buttons
142 case NativeTheme::kColorId_ButtonEnabledColor: 142 case NativeTheme::kColorId_TextOnEnabledDialogButton:
143 case NativeTheme::kColorId_ButtonHoverColor: 143 case NativeTheme::kColorId_ButtonHoverColor:
144 return kButtonEnabledColor; 144 return kButtonEnabledColor;
145 // TODO(estade): remove the BlueButton colors. 145 // TODO(estade): remove the BlueButton colors.
146 case NativeTheme::kColorId_BlueButtonEnabledColor: 146 case NativeTheme::kColorId_BlueButtonEnabledColor:
147 case NativeTheme::kColorId_BlueButtonDisabledColor: 147 case NativeTheme::kColorId_BlueButtonDisabledColor:
148 case NativeTheme::kColorId_BlueButtonPressedColor: 148 case NativeTheme::kColorId_BlueButtonPressedColor:
149 case NativeTheme::kColorId_BlueButtonHoverColor: 149 case NativeTheme::kColorId_BlueButtonHoverColor:
150 return kBlueButtonTextColor; 150 return kBlueButtonTextColor;
151 case NativeTheme::kColorId_BlueButtonShadowColor: 151 case NativeTheme::kColorId_BlueButtonShadowColor:
152 return kBlueButtonShadowColor; 152 return kBlueButtonShadowColor;
153 case NativeTheme::kColorId_ProminentButtonColor: 153 case NativeTheme::kColorId_ProminentButtonColor:
154 return kProminentButtonColor; 154 return kProminentButtonColor;
155 case NativeTheme::kColorId_TextOnProminentButtonColor: 155 case NativeTheme::kColorId_TextOnProminentDialogButton:
156 return kProminentButtonTextColor; 156 return kProminentButtonTextColor;
157 case NativeTheme::kColorId_ButtonPressedShade: 157 case NativeTheme::kColorId_ButtonPressedShade:
158 return SK_ColorTRANSPARENT; 158 return SK_ColorTRANSPARENT;
159 case NativeTheme::kColorId_ButtonDisabledColor: 159 case NativeTheme::kColorId_TextOnDisabledDialogButton:
160 return kDisabledMenuItemForegroundColor; 160 return kDisabledMenuItemForegroundColor;
161 161
162 // MenuItem 162 // MenuItem
163 case NativeTheme::kColorId_SelectedMenuItemForegroundColor: 163 case NativeTheme::kColorId_SelectedMenuItemForegroundColor:
164 return kSelectedMenuItemForegroundColor; 164 return kSelectedMenuItemForegroundColor;
165 case NativeTheme::kColorId_MenuBorderColor: 165 case NativeTheme::kColorId_MenuBorderColor:
166 return kMenuBorderColor; 166 return kMenuBorderColor;
167 case NativeTheme::kColorId_MenuSeparatorColor: 167 case NativeTheme::kColorId_MenuSeparatorColor:
168 return kMenuSeparatorColor; 168 return kMenuSeparatorColor;
169 case NativeTheme::kColorId_MenuBackgroundColor: 169 case NativeTheme::kColorId_MenuBackgroundColor:
170 return kMenuBackgroundColor; 170 return kMenuBackgroundColor;
171 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor: 171 case NativeTheme::kColorId_FocusedMenuItemBackgroundColor:
172 return kMenuHighlightBackgroundColor; 172 return kMenuHighlightBackgroundColor;
173 case NativeTheme::kColorId_EnabledMenuItemForegroundColor: 173 case NativeTheme::kColorId_EnabledMenuItemForegroundColor:
174 return kEnabledMenuItemForegroundColor; 174 return kEnabledMenuItemForegroundColor;
175 case NativeTheme::kColorId_DisabledMenuItemForegroundColor: 175 case NativeTheme::kColorId_DisabledMenuItemForegroundColor:
176 return kDisabledMenuItemForegroundColor; 176 return kDisabledMenuItemForegroundColor;
177 case NativeTheme::kColorId_MenuItemSubtitleColor: 177 case NativeTheme::kColorId_MenuItemSubtitleColor:
178 return base_theme->GetSystemColor( 178 return base_theme->GetSystemColor(
179 NativeTheme::kColorId_DisabledMenuItemForegroundColor); 179 NativeTheme::kColorId_DisabledMenuItemForegroundColor);
180 180
181 // Label 181 // Label
182 case NativeTheme::kColorId_LabelEnabledColor: 182 case NativeTheme::kColorId_LabelEnabledColor:
183 return kButtonEnabledColor; 183 return kButtonEnabledColor;
184 case NativeTheme::kColorId_LabelDisabledColor: 184 case NativeTheme::kColorId_LabelDisabledColor:
185 return base_theme->GetSystemColor( 185 return base_theme->GetSystemColor(
186 NativeTheme::kColorId_ButtonDisabledColor); 186 NativeTheme::kColorId_TextOnDisabledDialogButton);
187 case NativeTheme::kColorId_LabelTextSelectionColor: 187 case NativeTheme::kColorId_LabelTextSelectionColor:
188 return kTextSelectionColor; 188 return kTextSelectionColor;
189 case NativeTheme::kColorId_LabelTextSelectionBackgroundFocused: 189 case NativeTheme::kColorId_LabelTextSelectionBackgroundFocused:
190 return kTextSelectionBackgroundFocused; 190 return kTextSelectionBackgroundFocused;
191 191
192 // Link 192 // Link
193 // TODO(estade): where, if anywhere, do we use disabled links in Chrome? 193 // TODO(estade): where, if anywhere, do we use disabled links in Chrome?
194 case NativeTheme::kColorId_LinkDisabled: 194 case NativeTheme::kColorId_LinkDisabled:
195 return SK_ColorBLACK; 195 return SK_ColorBLACK;
196 196
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 if (menu_item.corner_radius > 0) { 348 if (menu_item.corner_radius > 0) {
349 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); 349 const SkScalar radius = SkIntToScalar(menu_item.corner_radius);
350 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, flags); 350 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, flags);
351 return; 351 return;
352 } 352 }
353 canvas->drawRect(gfx::RectToSkRect(rect), flags); 353 canvas->drawRect(gfx::RectToSkRect(rect), flags);
354 } 354 }
355 355
356 } // namespace ui 356 } // 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