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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/tray/actionable_view.h" 5 #include "ash/common/system/tray/actionable_view.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/system/tray/system_tray.h" 8 #include "ash/common/system/tray/system_tray.h"
9 #include "ash/common/system/tray/system_tray_item.h" 9 #include "ash/common/system/tray/system_tray_item.h"
10 #include "ash/common/system/tray/tray_constants.h" 10 #include "ash/common/system/tray/tray_constants.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 if (action_performed) { 121 if (action_performed) {
122 AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED, 122 AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED,
123 ui::LocatedEvent::FromIfValid(&event)); 123 ui::LocatedEvent::FromIfValid(&event));
124 } else { 124 } else {
125 AnimateInkDrop(views::InkDropState::HIDDEN, 125 AnimateInkDrop(views::InkDropState::HIDDEN,
126 ui::LocatedEvent::FromIfValid(&event)); 126 ui::LocatedEvent::FromIfValid(&event));
127 } 127 }
128 } 128 }
129 129
130 ButtonListenerActionableView::ButtonListenerActionableView(
131 SystemTrayItem* owner,
132 views::ButtonListener* listener)
133 : 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'.
134
135 ButtonListenerActionableView::~ButtonListenerActionableView() {
136 if (destroyed_)
137 *destroyed_ = true;
138 }
139
140 bool ButtonListenerActionableView::PerformAction(const ui::Event& event) {
141 bool destroyed = false;
142 destroyed_ = &destroyed;
143 listener_->ButtonPressed(this, event);
144 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.
145 return true;
146 destroyed_ = nullptr;
147 return true;
148 }
149
130 } // namespace ash 150 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698