Chromium Code Reviews| 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 |