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

Side by Side Diff: ash/common/system/chromeos/network/network_state_list_detailed_view.cc

Issue 2680643002: Add old_state parameter to CustomButton::StateChanged (Closed)
Patch Set: Created 3 years, 10 months 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/chromeos/network/network_state_list_detailed_view.h" 5 #include "ash/common/system/chromeos/network/network_state_list_detailed_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/common/ash_constants.h" 10 #include "ash/common/ash_constants.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 void SetVisible(bool visible) override { 257 void SetVisible(bool visible) override {
258 layer()->GetAnimator()->StopAnimating(); // Stop any previous animation. 258 layer()->GetAnimator()->StopAnimating(); // Stop any previous animation.
259 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator()); 259 ui::ScopedLayerAnimationSettings animation(layer()->GetAnimator());
260 animation.SetTransitionDuration( 260 animation.SetTransitionDuration(
261 base::TimeDelta::FromMilliseconds(kFadeIconMs)); 261 base::TimeDelta::FromMilliseconds(kFadeIconMs));
262 layer()->SetOpacity(visible ? 1.0 : 0.0); 262 layer()->SetOpacity(visible ? 1.0 : 0.0);
263 } 263 }
264 264
265 // views::CustomButton 265 // views::CustomButton
266 void StateChanged() override { 266 void StateChanged(ButtonState old_state) override {
267 if (state() == STATE_HOVERED || state() == STATE_PRESSED) { 267 if (state() == STATE_HOVERED || state() == STATE_PRESSED) {
268 set_background(views::Background::CreateSolidBackground( 268 set_background(views::Background::CreateSolidBackground(
269 kTrayPopupHoverBackgroundColor)); 269 kTrayPopupHoverBackgroundColor));
270 } else { 270 } else {
271 set_background(nullptr); 271 set_background(nullptr);
272 } 272 }
273 SchedulePaint(); 273 SchedulePaint();
274 } 274 }
275 275
276 private: 276 private:
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED); 1043 UMA_STATUS_AREA_NETWORK_JOIN_OTHER_CLICKED);
1044 WmShell::Get()->system_tray_controller()->ShowNetworkCreate(shill::kTypeWifi); 1044 WmShell::Get()->system_tray_controller()->ShowNetworkCreate(shill::kTypeWifi);
1045 } 1045 }
1046 1046
1047 void NetworkStateListDetailedView::RelayoutScrollList() { 1047 void NetworkStateListDetailedView::RelayoutScrollList() {
1048 scroller()->Layout(); 1048 scroller()->Layout();
1049 } 1049 }
1050 1050
1051 } // namespace tray 1051 } // namespace tray
1052 } // namespace ash 1052 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/audio/volume_view.cc ('k') | ash/common/system/tray/tray_popup_header_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698