Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(950)

Unified Diff: ash/common/system/tray/actionable_view.h

Issue 2482043002: [ash-md] Updated layout of Brightness and Audio system menu rows to the material design spec. (Closed)
Patch Set: Some polish after self review. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698