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

Unified Diff: ui/views/controls/combobox/combobox.cc

Issue 1817613002: MacViews: draw Mac combobox arrows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove noop image_bounds Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/native_theme/native_theme_win.cc ('k') | ui/views/style/platform_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox.cc
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index 88cd6efcd828144ff173e548ec2d958d3ce94dbf..3de636fbdc15b1add675be3c316968e7afca2c1f 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -752,19 +752,9 @@ void Combobox::PaintText(gfx::Canvas* canvas) {
arrow_size.height());
AdjustBoundsForRTLUI(&arrow_bounds);
- // TODO(estade): hack alert! Remove this direct call into CommonTheme. For now
- // STYLE_ACTION isn't properly themed so we have to override the NativeTheme
- // behavior. See crbug.com/384071
- if (style_ == STYLE_ACTION) {
- ui::CommonThemePaintComboboxArrow(canvas->sk_canvas(), arrow_bounds);
- } else {
- ui::NativeTheme::ExtraParams ignored;
- GetNativeTheme()->Paint(canvas->sk_canvas(),
- ui::NativeTheme::kComboboxArrow,
- ui::NativeTheme::kNormal,
- arrow_bounds,
- ignored);
- }
+ gfx::ImageSkia arrow_image = PlatformStyle::CreateComboboxArrow(
+ enabled(), style_);
+ canvas->DrawImageInt(arrow_image, arrow_bounds.x(), arrow_bounds.y());
}
void Combobox::PaintButtons(gfx::Canvas* canvas) {
@@ -905,21 +895,7 @@ int Combobox::GetDisclosureArrowRightPadding() const {
}
gfx::Size Combobox::ArrowSize() const {
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
- // TODO(estade): hack alert! This should always use GetNativeTheme(). For now
- // STYLE_ACTION isn't properly themed so we have to override the NativeTheme
- // behavior. See crbug.com/384071
- const ui::NativeTheme* native_theme_for_arrow =
- style_ == STYLE_ACTION ? ui::NativeThemeAura::instance()
- : GetNativeTheme();
-#else
- const ui::NativeTheme* native_theme_for_arrow = GetNativeTheme();
-#endif
-
- ui::NativeTheme::ExtraParams ignored;
- return native_theme_for_arrow->GetPartSize(ui::NativeTheme::kComboboxArrow,
- ui::NativeTheme::kNormal,
- ignored);
+ return PlatformStyle::CreateComboboxArrow(enabled(), style_).size();
}
gfx::Size Combobox::GetContentSize() const {
« no previous file with comments | « ui/native_theme/native_theme_win.cc ('k') | ui/views/style/platform_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698