Chromium Code Reviews| Index: ui/views/style/platform_style.cc |
| diff --git a/ui/views/style/platform_style.cc b/ui/views/style/platform_style.cc |
| index 9027c6632dd0f0365d3ca45922c63e357c996c3c..dc49691d9a110b10a6733f87cb65f89c1aa6f98f 100644 |
| --- a/ui/views/style/platform_style.cc |
| +++ b/ui/views/style/platform_style.cc |
| @@ -56,6 +56,16 @@ std::unique_ptr<Background> PlatformStyle::CreateComboboxBackground() { |
| } |
| // static |
| +std::unique_ptr<Background> PlatformStyle::CreateMenuButtonBackground() { |
| + return nullptr; |
| +} |
| + |
| +// static |
| +std::unique_ptr<FocusableBorder> PlatformStyle::CreateMenuButtonBorder() { |
| + return base::WrapUnique(new FocusableBorder()); |
| +} |
| + |
| +// static |
| std::unique_ptr<LabelButtonBorder> PlatformStyle::CreateLabelButtonBorder( |
| Button::ButtonStyle style) { |
| if (!ui::MaterialDesignController::IsModeMaterial() || |
| @@ -70,6 +80,12 @@ std::unique_ptr<LabelButtonBorder> PlatformStyle::CreateLabelButtonBorder( |
| } |
| // static |
| +gfx::ImageSkia PlatformStyle::CreateMenuButtonArrow(bool is_enabled) { |
| + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| + return *rb.GetImageSkiaNamed(IDR_MENU_DROPARROW); |
| +} |
| + |
| +// static |
| std::unique_ptr<ScrollBar> PlatformStyle::CreateScrollBar(bool is_horizontal) { |
| return base::WrapUnique(new NativeScrollBar(is_horizontal)); |
| } |
| @@ -83,6 +99,29 @@ SkColor PlatformStyle::TextColorForButton( |
| #endif // OS_MACOSX |
| +// This definition is used even on Mac, but Mac has its own |
| +// CreateComboboxArrow() so it will return something different on Mac. |
| +// static |
| +int PlatformStyle::GetComboboxArrowWidth(Combobox::Style style) { |
| + const int kNormalLeftPadding = 7; |
| + const int kNormalRightPadding = 7; |
|
tapted
2016/04/21 06:06:46
I think we can collapse the left/right and just ca
Elly Fong-Jones
2016/04/21 15:30:27
Done.
|
| + const int kActionLeftPadding = 11; |
| + const int kActionRightPadding = 12; |
| + int padding = style == Combobox::STYLE_NORMAL |
| + ? kNormalLeftPadding + kNormalRightPadding |
| + : kActionLeftPadding + kActionRightPadding; |
| + int image_width = CreateComboboxArrow(true, style).size().width(); |
| + return padding + image_width; |
| +} |
| + |
| +// static |
| +int PlatformStyle::GetMenuButtonArrowWidth() { |
| + const int kLeftPadding = 7; |
| + const int kRightPadding = 7; |
| + return kLeftPadding + kRightPadding + |
| + CreateMenuButtonArrow(true).size().width(); |
| +} |
| + |
| #if !defined(DESKTOP_LINUX) && !defined(OS_MACOSX) |
| // static |
| void PlatformStyle::ApplyLabelButtonTextStyle( |