Chromium Code Reviews| 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..8fa620e788d1062cb59c20e13a5f55cb489b4b5f 100644 |
| --- a/ui/views/controls/combobox/combobox.cc |
| +++ b/ui/views/controls/combobox/combobox.cc |
| @@ -752,19 +752,11 @@ 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_); |
| + gfx::Rect image_bounds(arrow_bounds); |
| + image_bounds.ClampToCenteredSize(arrow_bounds.size()); |
| + canvas->DrawImageInt(arrow_image, image_bounds.x(), image_bounds.y()); |
|
tapted
2016/04/05 08:45:02
I have a theory, that you could write something li
Elly Fong-Jones
2016/04/05 20:04:24
It looks like it exploded on the Windows bots.
tapted
2016/04/06 00:07:08
https://codereview.chromium.org/1863503002/#ps6000
Elly Fong-Jones
2016/04/06 16:20:21
Ya, sorry - I should have realized that these two
|
| } |
| void Combobox::PaintButtons(gfx::Canvas* canvas) { |
| @@ -905,21 +897,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 { |