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

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

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.cc
diff --git a/ash/common/system/tray/actionable_view.cc b/ash/common/system/tray/actionable_view.cc
index 07be3c018ee83d232b94863122483498c9e338f0..566a5c7cb4cb4bbc583ab8f3601fb0d2bf31e553 100644
--- a/ash/common/system/tray/actionable_view.cc
+++ b/ash/common/system/tray/actionable_view.cc
@@ -127,4 +127,24 @@ void ActionableView::ButtonPressed(Button* sender, const ui::Event& event) {
}
}
+ButtonListenerActionableView::ButtonListenerActionableView(
+ SystemTrayItem* owner,
+ views::ButtonListener* listener)
+ : ActionableView(owner), listener_(listener), destroyed_(nullptr) {}
tdanderson 2016/11/09 01:38:33 did you run git cl format ash? This looks a bit of
bruthig 2016/11/10 02:54:54 Yeah, this is the result of 'git cl format'.
+
+ButtonListenerActionableView::~ButtonListenerActionableView() {
+ if (destroyed_)
+ *destroyed_ = true;
+}
+
+bool ButtonListenerActionableView::PerformAction(const ui::Event& event) {
+ bool destroyed = false;
+ destroyed_ = &destroyed;
+ listener_->ButtonPressed(this, event);
+ if (destroyed)
tdanderson 2016/11/09 01:38:33 I'm not sure what this gains you, since the only p
bruthig 2016/11/10 02:54:54 Not sure why I had this here. Removed.
+ return true;
+ destroyed_ = nullptr;
+ return true;
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698