Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar/toolbar_button.cc |
| diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| index cf2e626384f1695631238f10ba4d0867ef99b4f4..42652f6e077353e6940827f58b40452f32603abc 100644 |
| --- a/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| +++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc |
| @@ -18,6 +18,7 @@ |
| #include "ui/gfx/display.h" |
| #include "ui/gfx/screen.h" |
| #include "ui/strings/grit/ui_strings.h" |
| +#include "ui/views/animation/ink_drop_animation_controller.h" |
| #include "ui/views/controls/button/label_button_border.h" |
| #include "ui/views/controls/menu/menu_item_view.h" |
| #include "ui/views/controls/menu/menu_model_adapter.h" |
| @@ -30,7 +31,16 @@ ToolbarButton::ToolbarButton(views::ButtonListener* listener, |
| model_(model), |
| menu_showing_(false), |
| y_position_on_lbuttondown_(0), |
| + ink_drop_animation_controller_(nullptr), |
|
Peter Kasting
2015/07/17 18:01:58
Omit this.
bruthig
2015/07/20 14:53:07
Done.
|
| show_menu_factory_(this) { |
| +#if defined(OS_CHROMEOS) |
|
Peter Kasting
2015/07/17 18:01:58
Why is this OS_CHROMEOS? Can't we do this for all
bruthig
2015/07/20 14:53:07
The designers want the ripple effect on Chrome OS
|
| + if (ui::MaterialDesignController::IsModeMaterial()) { |
| + ink_drop_animation_controller_.reset( |
| + new views::InkDropAnimationController(this)); |
| + layer()->SetFillsBoundsOpaquely(false); |
|
Peter Kasting
2015/07/17 18:01:58
Why do we need this if it's unconditionally done o
bruthig
2015/07/20 14:53:07
Line 55 is operating on image() whereas this is op
|
| + } |
| +#endif // defined(OS_CHROMEOS) |
| + |
| set_context_menu_controller(this); |
| } |
| @@ -41,6 +51,8 @@ void ToolbarButton::Init() { |
| SetFocusable(false); |
| SetAccessibilityFocusable(true); |
| image()->EnableCanvasFlippingForRTLUI(true); |
| + image()->SetPaintToLayer(true); |
| + image()->SetFillsBoundsOpaquely(false); |
| } |
| void ToolbarButton::ClearPendingMenu() { |
| @@ -148,6 +160,15 @@ ToolbarButton::CreateDefaultBorder() const { |
| scoped_ptr<views::LabelButtonBorder> border = |
| LabelButton::CreateDefaultBorder(); |
| + if (ui::MaterialDesignController::IsModeMaterial()) { |
|
Peter Kasting
2015/07/17 18:01:58
I suggest adding a comment on this block as to why
bruthig
2015/07/20 14:53:07
Done.
|
| + border->SetPainter(true, Button::STATE_HOVERED, nullptr); |
| + border->SetPainter(false, Button::STATE_HOVERED, nullptr); |
| +#if defined(OS_CHROMEOS) |
| + border->SetPainter(true, Button::STATE_PRESSED, nullptr); |
| + border->SetPainter(false, Button::STATE_PRESSED, nullptr); |
| +#endif // defined(OS_CHROMEOS) |
| + } |
| + |
| ui::ThemeProvider* provider = GetThemeProvider(); |
| if (provider && provider->UsingSystemTheme()) { |
| // Theme provided insets. |