| Index: chrome/browser/ui/views/toolbar/toolbar_action_view.h
|
| diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.h b/chrome/browser/ui/views/toolbar/toolbar_action_view.h
|
| index 19db601bd4259643ec4d5a6c19e8b5d3521556f4..8b0549b724b08eabe9e0ff80ef4287446601e9d9 100644
|
| --- a/chrome/browser/ui/views/toolbar/toolbar_action_view.h
|
| +++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.h
|
| @@ -8,6 +8,7 @@
|
| #include "chrome/browser/ui/views/toolbar/toolbar_action_view_delegate_views.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| +#include "ui/views/animation/ink_drop_host.h"
|
| #include "ui/views/context_menu_controller.h"
|
| #include "ui/views/controls/button/menu_button.h"
|
| #include "ui/views/controls/button/menu_button_listener.h"
|
| @@ -26,6 +27,7 @@ class Image;
|
| }
|
|
|
| namespace views {
|
| +class InkDropAnimationController;
|
| class MenuRunner;
|
| }
|
|
|
| @@ -37,7 +39,8 @@ class ToolbarActionView : public views::MenuButton,
|
| public ToolbarActionViewDelegateViews,
|
| public views::MenuButtonListener,
|
| public views::ContextMenuController,
|
| - public content::NotificationObserver {
|
| + public content::NotificationObserver,
|
| + public views::InkDropHost {
|
| public:
|
| // Need DragController here because ToolbarActionView could be
|
| // dragged/dropped.
|
| @@ -74,6 +77,7 @@ class ToolbarActionView : public views::MenuButton,
|
| // views::MenuButtonListener:
|
| void OnMenuButtonClicked(views::View* sender,
|
| const gfx::Point& point) override;
|
| + void OnMenuButtonClickCanceled(views::View* sender) override;
|
|
|
| // content::NotificationObserver:
|
| void Observe(int type,
|
| @@ -98,9 +102,26 @@ class ToolbarActionView : public views::MenuButton,
|
|
|
| bool wants_to_run_for_testing() const { return wants_to_run_; }
|
|
|
| + // views::InkDropHost:
|
| + void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
|
| + void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
|
| +
|
| + protected:
|
| + // Returns the Point where the ink drop should be centered.
|
| + virtual gfx::Point CalculateInkDropCenter() const;
|
| +
|
| + views::InkDropAnimationController* ink_drop_animation_controller() {
|
| + return ink_drop_animation_controller_.get();
|
| + }
|
| +
|
| + views::InkDropDelegate* GetInkDropDelegate() const override;
|
| +
|
| private:
|
| // views::MenuButton:
|
| gfx::Size GetPreferredSize() const override;
|
| + void Layout() override;
|
| + bool OnMousePressed(const ui::MouseEvent& event) override;
|
| + void OnGestureEvent(ui::GestureEvent* event) override;
|
| void OnDragDone() override;
|
| void ViewHierarchyChanged(
|
| const ViewHierarchyChangedDetails& details) override;
|
| @@ -146,6 +167,9 @@ class ToolbarActionView : public views::MenuButton,
|
| // tab.
|
| bool wants_to_run_;
|
|
|
| + // Indicates if menu is currently showing.
|
| + bool menu_showing_;
|
| +
|
| // Responsible for running the menu.
|
| scoped_ptr<views::MenuRunner> menu_runner_;
|
|
|
| @@ -158,6 +182,11 @@ class ToolbarActionView : public views::MenuButton,
|
|
|
| content::NotificationRegistrar registrar_;
|
|
|
| + // Animation controller for the ink drop ripple effect.
|
| + scoped_ptr<views::InkDropAnimationController> ink_drop_animation_controller_;
|
| +
|
| + scoped_ptr<views::InkDropDelegate> ink_drop_delegate_;
|
| +
|
| base::WeakPtrFactory<ToolbarActionView> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ToolbarActionView);
|
|
|