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

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

Issue 2345183002: Views: Draw Textfield selected text in gray when top-level Widget loses focus.
Patch Set: Refactor to use SelectionController(Delegate). Unfinished! Created 4 years 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 | « ui/gfx/render_text.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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return kTextfieldDefaultColor; 209 return kTextfieldDefaultColor;
210 case NativeTheme::kColorId_TextfieldDefaultBackground: 210 case NativeTheme::kColorId_TextfieldDefaultBackground:
211 return kTextfieldDefaultBackground; 211 return kTextfieldDefaultBackground;
212 case NativeTheme::kColorId_TextfieldReadOnlyColor: 212 case NativeTheme::kColorId_TextfieldReadOnlyColor:
213 return kTextfieldReadOnlyColor; 213 return kTextfieldReadOnlyColor;
214 case NativeTheme::kColorId_TextfieldReadOnlyBackground: 214 case NativeTheme::kColorId_TextfieldReadOnlyBackground:
215 return kTextfieldReadOnlyBackground; 215 return kTextfieldReadOnlyBackground;
216 case NativeTheme::kColorId_TextfieldSelectionColor: 216 case NativeTheme::kColorId_TextfieldSelectionColor:
217 return kTextSelectionColor; 217 return kTextSelectionColor;
218 case NativeTheme::kColorId_TextfieldSelectionBackgroundFocused: 218 case NativeTheme::kColorId_TextfieldSelectionBackgroundFocused:
219 // Fallthrough intended.
220 case NativeTheme::kColorId_TextfieldSelectionBackgroundUnfocused:
219 return kTextSelectionBackgroundFocused; 221 return kTextSelectionBackgroundFocused;
220 222
221 // Tooltip 223 // Tooltip
222 case NativeTheme::kColorId_TooltipBackground: 224 case NativeTheme::kColorId_TooltipBackground:
223 return kTooltipBackground; 225 return kTooltipBackground;
224 case NativeTheme::kColorId_TooltipText: 226 case NativeTheme::kColorId_TooltipText:
225 return kTooltipTextColor; 227 return kTooltipTextColor;
226 228
227 // Tree 229 // Tree
228 case NativeTheme::kColorId_TreeBackground: 230 case NativeTheme::kColorId_TreeBackground:
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 343 }
342 if (menu_item.corner_radius > 0) { 344 if (menu_item.corner_radius > 0) {
343 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); 345 const SkScalar radius = SkIntToScalar(menu_item.corner_radius);
344 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); 346 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint);
345 return; 347 return;
346 } 348 }
347 canvas->drawRect(gfx::RectToSkRect(rect), paint); 349 canvas->drawRect(gfx::RectToSkRect(rect), paint);
348 } 350 }
349 351
350 } // namespace ui 352 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698