Chromium Code Reviews| Index: ash/common/system/tray/actionable_view.h |
| diff --git a/ash/common/system/tray/actionable_view.h b/ash/common/system/tray/actionable_view.h |
| index 1dd60b4b41b68d3e63f6cf764c9ad286868baf64..167fe09aeacf92064a999caf4ad22fdede685356 100644 |
| --- a/ash/common/system/tray/actionable_view.h |
| +++ b/ash/common/system/tray/actionable_view.h |
| @@ -80,6 +80,28 @@ class ASH_EXPORT ActionableView : public views::ButtonListener, |
| DISALLOW_COPY_AND_ASSIGN(ActionableView); |
| }; |
| +// An ActionableView that can be used with a ButtonListener instead of having to |
| +// extend ActionableView and override PerformAction(). |
| +class ASH_EXPORT ButtonListenerActionableView : public ActionableView { |
| + public: |
| + ButtonListenerActionableView(SystemTrayItem* owner, |
| + views::ButtonListener* listener); |
| + ~ButtonListenerActionableView() override; |
| + |
| + // ActionableView: |
| + bool PerformAction(const ui::Event& event) override; |
| + |
| + private: |
| + views::ButtonListener* listener_; |
| + |
| + // Used by ButtonPressed() to determine whether |this| has been destroyed as a |
|
tdanderson
2016/11/09 01:38:33
Copy-paste from the above class?
bruthig
2016/11/10 02:54:54
Removed.
|
| + // result of performing the associated action. This is necessary because in |
| + // the not-destroyed case ButtonPressed() uses member variables. |
| + bool* destroyed_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ButtonListenerActionableView); |
| +}; |
| + |
| } // namespace ash |
| #endif // ASH_COMMON_SYSTEM_TRAY_ACTIONABLE_VIEW_H_ |