Chromium Code Reviews| Index: chrome/browser/ui/views/toolbar/toolbar_button.h |
| diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.h b/chrome/browser/ui/views/toolbar/toolbar_button.h |
| index 27257239e6b686f1d126faad0e64795d998ca94d..a6f970a78b9e77a83e378ec590fe9daede694f42 100644 |
| --- a/chrome/browser/ui/views/toolbar/toolbar_button.h |
| +++ b/chrome/browser/ui/views/toolbar/toolbar_button.h |
| @@ -6,6 +6,7 @@ |
| #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_BUTTON_H_ |
| #include "base/memory/scoped_ptr.h" |
| +#include "ui/views/animation/ink_drop_host.h" |
| #include "ui/views/context_menu_controller.h" |
| #include "ui/views/controls/button/button.h" |
| #include "ui/views/controls/button/label_button.h" |
| @@ -22,7 +23,8 @@ class MenuRunner; |
| // This class provides basic drawing and mouse-over behavior for buttons |
| // appearing in the toolbar. |
| class ToolbarButton : public views::LabelButton, |
| - public views::ContextMenuController { |
| + public views::ContextMenuController, |
| + public views::InkDropHost { |
| public: |
| // Takes ownership of the |model|, which can be null if no menu |
| // is to be shown. |
| @@ -39,6 +41,7 @@ class ToolbarButton : public views::LabelButton, |
| // views::LabelButton: |
| gfx::Size GetPreferredSize() const override; |
| + void Layout() override; |
| bool OnMousePressed(const ui::MouseEvent& event) override; |
| bool OnMouseDragged(const ui::MouseEvent& event) override; |
| void OnMouseReleased(const ui::MouseEvent& event) override; |
| @@ -54,6 +57,10 @@ class ToolbarButton : public views::LabelButton, |
| const gfx::Point& point, |
| ui::MenuSourceType source_type) override; |
| + // views::InkDropHost: |
| + void AddInkDropLayer(ui::Layer* ink_drop_layer) override; |
| + void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; |
| + |
| protected: |
| // Overridden from CustomButton. Returns true if the button should become |
| // pressed when a user holds the mouse down over the button. For this |
| @@ -67,6 +74,14 @@ class ToolbarButton : public views::LabelButton, |
| // Function to show the dropdown menu. |
| virtual void ShowDropDownMenu(ui::MenuSourceType source_type); |
| + views::InkDropAnimationController* ink_drop_animation_controller() { |
| + return ink_drop_animation_controller_.get(); |
| + } |
|
Peter Kasting
2015/08/12 20:04:32
Nit: Put this accessor below the next function so
bruthig
2015/08/13 15:15:45
Done, I moved it up to be with the other non-virtu
Peter Kasting
2015/08/13 18:34:08
That method is actually virtual as well (see the "
bruthig
2015/08/14 14:17:39
Done.
|
| + |
| + // Performs a layout of the ink drop. i.e. Sets the ink drop's size and/or |
| + // bounds. |
|
Peter Kasting
2015/08/12 20:04:32
Nit: The second part of this comment just restates
bruthig
2015/08/13 15:15:45
Done.
|
| + virtual void LayoutInkDrop(); |
| + |
| private: |
| // views::LabelButton: |
| const char* GetClassName() const override; |