| OLD | NEW |
| 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 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 views::View* SystemTrayItem::CreateDefaultView(LoginStatus status) { | 24 views::View* SystemTrayItem::CreateDefaultView(LoginStatus status) { |
| 25 return nullptr; | 25 return nullptr; |
| 26 } | 26 } |
| 27 | 27 |
| 28 views::View* SystemTrayItem::CreateDetailedView(LoginStatus status) { | 28 views::View* SystemTrayItem::CreateDetailedView(LoginStatus status) { |
| 29 return nullptr; | 29 return nullptr; |
| 30 } | 30 } |
| 31 | 31 |
| 32 views::View* SystemTrayItem::CreateNotificationView(LoginStatus status) { | |
| 33 return nullptr; | |
| 34 } | |
| 35 | |
| 36 void SystemTrayItem::DestroyTrayView() {} | 32 void SystemTrayItem::DestroyTrayView() {} |
| 37 | 33 |
| 38 void SystemTrayItem::DestroyDefaultView() {} | 34 void SystemTrayItem::DestroyDefaultView() {} |
| 39 | 35 |
| 40 void SystemTrayItem::DestroyDetailedView() {} | 36 void SystemTrayItem::DestroyDetailedView() {} |
| 41 | 37 |
| 42 void SystemTrayItem::DestroyNotificationView() {} | |
| 43 | |
| 44 void SystemTrayItem::TransitionDetailedView() { | 38 void SystemTrayItem::TransitionDetailedView() { |
| 45 const int transition_delay = | 39 const int transition_delay = |
| 46 GetTrayConstant(TRAY_POPUP_TRANSITION_TO_DETAILED_DELAY); | 40 GetTrayConstant(TRAY_POPUP_TRANSITION_TO_DETAILED_DELAY); |
| 47 if (transition_delay <= 0) { | 41 if (transition_delay <= 0) { |
| 48 DoTransitionToDetailedView(); | 42 DoTransitionToDetailedView(); |
| 49 return; | 43 return; |
| 50 } | 44 } |
| 51 transition_delay_timer_.reset(new base::OneShotTimer()); | 45 transition_delay_timer_.reset(new base::OneShotTimer()); |
| 52 transition_delay_timer_->Start( | 46 transition_delay_timer_->Start( |
| 53 FROM_HERE, base::TimeDelta::FromMilliseconds(transition_delay), this, | 47 FROM_HERE, base::TimeDelta::FromMilliseconds(transition_delay), this, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 65 } | 59 } |
| 66 | 60 |
| 67 void SystemTrayItem::SetDetailedViewCloseDelay(int for_seconds) { | 61 void SystemTrayItem::SetDetailedViewCloseDelay(int for_seconds) { |
| 68 system_tray()->SetDetailedViewCloseDelay(for_seconds); | 62 system_tray()->SetDetailedViewCloseDelay(for_seconds); |
| 69 } | 63 } |
| 70 | 64 |
| 71 void SystemTrayItem::HideDetailedView(bool animate) { | 65 void SystemTrayItem::HideDetailedView(bool animate) { |
| 72 system_tray()->HideDetailedView(this, animate); | 66 system_tray()->HideDetailedView(this, animate); |
| 73 } | 67 } |
| 74 | 68 |
| 75 void SystemTrayItem::ShowNotificationView() { | |
| 76 system_tray()->ShowNotificationView(this); | |
| 77 } | |
| 78 | |
| 79 void SystemTrayItem::HideNotificationView() { | |
| 80 system_tray()->HideNotificationView(this); | |
| 81 } | |
| 82 | |
| 83 bool SystemTrayItem::ShouldShowShelf() const { | 69 bool SystemTrayItem::ShouldShowShelf() const { |
| 84 return true; | 70 return true; |
| 85 } | 71 } |
| 86 | 72 |
| 87 void SystemTrayItem::DoTransitionToDetailedView() { | 73 void SystemTrayItem::DoTransitionToDetailedView() { |
| 88 transition_delay_timer_.reset(); | 74 transition_delay_timer_.reset(); |
| 89 system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING); | 75 system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING); |
| 90 } | 76 } |
| 91 | 77 |
| 92 } // namespace ash | 78 } // namespace ash |
| OLD | NEW |