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

Side by Side Diff: ash/common/system/tray/system_tray_item.cc

Issue 2698213004: Start removing some pre-md constants and related code. (Closed)
Patch Set: actually use the constant 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
« no previous file with comments | « ash/common/system/tray/system_tray_item.h ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/tray/system_tray_item.h" 5 #include "ash/common/system/tray/system_tray_item.h"
6 6
7 #include "ash/common/system/tray/system_tray.h" 7 #include "ash/common/system/tray/system_tray.h"
8 #include "ash/common/system/tray/system_tray_delegate.h" 8 #include "ash/common/system/tray/system_tray_delegate.h"
9 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
(...skipping 24 matching lines...) Expand all
35 35
36 void SystemTrayItem::DestroyTrayView() {} 36 void SystemTrayItem::DestroyTrayView() {}
37 37
38 void SystemTrayItem::DestroyDefaultView() {} 38 void SystemTrayItem::DestroyDefaultView() {}
39 39
40 void SystemTrayItem::DestroyDetailedView() {} 40 void SystemTrayItem::DestroyDetailedView() {}
41 41
42 void SystemTrayItem::DestroyNotificationView() {} 42 void SystemTrayItem::DestroyNotificationView() {}
43 43
44 void SystemTrayItem::TransitionDetailedView() { 44 void SystemTrayItem::TransitionDetailedView() {
45 const int transition_delay = 45 transition_delay_timer_.Start(
46 GetTrayConstant(TRAY_POPUP_TRANSITION_TO_DETAILED_DELAY); 46 FROM_HERE,
47 if (transition_delay <= 0) { 47 base::TimeDelta::FromMilliseconds(kTrayDetailedViewTransitionDelayMs),
48 DoTransitionToDetailedView(); 48 base::Bind(&SystemTray::ShowDetailedView, base::Unretained(system_tray()),
49 return; 49 this, 0, true, BUBBLE_USE_EXISTING));
50 }
51 transition_delay_timer_.reset(new base::OneShotTimer());
52 transition_delay_timer_->Start(
53 FROM_HERE, base::TimeDelta::FromMilliseconds(transition_delay), this,
54 &SystemTrayItem::DoTransitionToDetailedView);
55 } 50 }
56 51
57 void SystemTrayItem::UpdateAfterLoginStatusChange(LoginStatus status) {} 52 void SystemTrayItem::UpdateAfterLoginStatusChange(LoginStatus status) {}
58 53
59 void SystemTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { 54 void SystemTrayItem::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) {
60 } 55 }
61 56
62 void SystemTrayItem::PopupDetailedView(int for_seconds, bool activate) { 57 void SystemTrayItem::PopupDetailedView(int for_seconds, bool activate) {
63 system_tray()->ShowDetailedView(this, for_seconds, activate, 58 system_tray()->ShowDetailedView(this, for_seconds, activate,
64 BUBBLE_CREATE_NEW); 59 BUBBLE_CREATE_NEW);
(...skipping 12 matching lines...) Expand all
77 } 72 }
78 73
79 void SystemTrayItem::HideNotificationView() { 74 void SystemTrayItem::HideNotificationView() {
80 system_tray()->HideNotificationView(this); 75 system_tray()->HideNotificationView(this);
81 } 76 }
82 77
83 bool SystemTrayItem::ShouldShowShelf() const { 78 bool SystemTrayItem::ShouldShowShelf() const {
84 return true; 79 return true;
85 } 80 }
86 81
87 void SystemTrayItem::DoTransitionToDetailedView() {
88 transition_delay_timer_.reset();
89 system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING);
90 }
91
92 } // namespace ash 82 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray_item.h ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698