| 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/date/tray_date.h" | 5 #include "ash/common/system/date/tray_date.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/wm_shelf_util.h" | 7 #include "ash/common/shelf/wm_shelf_util.h" |
| 8 #include "ash/common/system/chromeos/system_clock_observer.h" | 8 #include "ash/common/system/chromeos/system_clock_observer.h" |
| 9 #include "ash/common/system/date/date_default_view.h" | 9 #include "ash/common/system/date/date_default_view.h" |
| 10 #include "ash/common/system/date/date_view.h" | 10 #include "ash/common/system/date/date_view.h" |
| 11 #include "ash/common/system/tray/system_tray.h" | 11 #include "ash/common/system/tray/system_tray.h" |
| 12 #include "ash/common/system/tray/system_tray_notifier.h" | 12 #include "ash/common/system/tray/system_tray_notifier.h" |
| 13 #include "ash/common/system/tray/tray_item_view.h" | 13 #include "ash/common/system/tray/tray_item_view.h" |
| 14 #include "ash/common/wm_shell.h" | 14 #include "ash/shell.h" |
| 15 | 15 |
| 16 namespace ash { | 16 namespace ash { |
| 17 | 17 |
| 18 TrayDate::TrayDate(SystemTray* system_tray) | 18 TrayDate::TrayDate(SystemTray* system_tray) |
| 19 : SystemTrayItem(system_tray, UMA_DATE), | 19 : SystemTrayItem(system_tray, UMA_DATE), |
| 20 time_tray_(NULL), | 20 time_tray_(NULL), |
| 21 default_view_(NULL), | 21 default_view_(NULL), |
| 22 login_status_(LoginStatus::NOT_LOGGED_IN), | 22 login_status_(LoginStatus::NOT_LOGGED_IN), |
| 23 system_clock_observer_(new SystemClockObserver()) { | 23 system_clock_observer_(new SystemClockObserver()) { |
| 24 WmShell::Get()->system_tray_notifier()->AddClockObserver(this); | 24 Shell::Get()->system_tray_notifier()->AddClockObserver(this); |
| 25 } | 25 } |
| 26 | 26 |
| 27 TrayDate::~TrayDate() { | 27 TrayDate::~TrayDate() { |
| 28 WmShell::Get()->system_tray_notifier()->RemoveClockObserver(this); | 28 Shell::Get()->system_tray_notifier()->RemoveClockObserver(this); |
| 29 } | 29 } |
| 30 | 30 |
| 31 views::View* TrayDate::GetHelpButtonView() const { | 31 views::View* TrayDate::GetHelpButtonView() const { |
| 32 if (!default_view_) | 32 if (!default_view_) |
| 33 return NULL; | 33 return NULL; |
| 34 return default_view_->GetHelpButtonView(); | 34 return default_view_->GetHelpButtonView(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 const tray::TimeView* TrayDate::GetTimeTrayForTesting() const { | 37 const tray::TimeView* TrayDate::GetTimeTrayForTesting() const { |
| 38 return time_tray_; | 38 return time_tray_; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 : tray::DateView::DateAction::NONE); | 117 : tray::DateView::DateAction::NONE); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 void TrayDate::Refresh() { | 121 void TrayDate::Refresh() { |
| 122 if (time_tray_) | 122 if (time_tray_) |
| 123 time_tray_->UpdateText(); | 123 time_tray_->UpdateText(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace ash | 126 } // namespace ash |
| OLD | NEW |