| 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/system/date/tray_date.h" | 5 #include "ash/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/tray/tray_item_view.h" | 8 #include "ash/common/system/tray/tray_item_view.h" |
| 9 #include "ash/shelf/shelf_util.h" | 9 #include "ash/common/system/tray/wm_system_tray_notifier.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/common/wm_shell.h" |
| 11 #include "ash/system/date/date_default_view.h" | 11 #include "ash/system/date/date_default_view.h" |
| 12 #include "ash/system/date/date_view.h" | 12 #include "ash/system/date/date_view.h" |
| 13 #include "ash/system/tray/system_tray.h" | 13 #include "ash/system/tray/system_tray.h" |
| 14 #include "ash/system/tray/system_tray_notifier.h" | |
| 15 | 14 |
| 16 #if defined(OS_CHROMEOS) | 15 #if defined(OS_CHROMEOS) |
| 17 #include "ash/system/chromeos/system_clock_observer.h" | 16 #include "ash/system/chromeos/system_clock_observer.h" |
| 18 #endif | 17 #endif |
| 19 | 18 |
| 20 namespace ash { | 19 namespace ash { |
| 21 | 20 |
| 22 TrayDate::TrayDate(SystemTray* system_tray) | 21 TrayDate::TrayDate(SystemTray* system_tray) |
| 23 : SystemTrayItem(system_tray), | 22 : SystemTrayItem(system_tray), |
| 24 time_tray_(NULL), | 23 time_tray_(NULL), |
| 25 default_view_(NULL), | 24 default_view_(NULL), |
| 26 login_status_(LoginStatus::NOT_LOGGED_IN) { | 25 login_status_(LoginStatus::NOT_LOGGED_IN) { |
| 27 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| 28 system_clock_observer_.reset(new SystemClockObserver()); | 27 system_clock_observer_.reset(new SystemClockObserver()); |
| 29 #endif | 28 #endif |
| 30 Shell::GetInstance()->system_tray_notifier()->AddClockObserver(this); | 29 WmShell::Get()->system_tray_notifier()->AddClockObserver(this); |
| 31 } | 30 } |
| 32 | 31 |
| 33 TrayDate::~TrayDate() { | 32 TrayDate::~TrayDate() { |
| 34 Shell::GetInstance()->system_tray_notifier()->RemoveClockObserver(this); | 33 WmShell::Get()->system_tray_notifier()->RemoveClockObserver(this); |
| 35 } | 34 } |
| 36 | 35 |
| 37 views::View* TrayDate::GetHelpButtonView() const { | 36 views::View* TrayDate::GetHelpButtonView() const { |
| 38 if (!default_view_) | 37 if (!default_view_) |
| 39 return NULL; | 38 return NULL; |
| 40 return default_view_->GetHelpButtonView(); | 39 return default_view_->GetHelpButtonView(); |
| 41 } | 40 } |
| 42 | 41 |
| 43 const tray::TimeView* TrayDate::GetTimeTrayForTesting() const { | 42 const tray::TimeView* TrayDate::GetTimeTrayForTesting() const { |
| 44 return time_tray_; | 43 return time_tray_; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); | 122 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); |
| 124 } | 123 } |
| 125 } | 124 } |
| 126 | 125 |
| 127 void TrayDate::Refresh() { | 126 void TrayDate::Refresh() { |
| 128 if (time_tray_) | 127 if (time_tray_) |
| 129 time_tray_->UpdateText(); | 128 time_tray_->UpdateText(); |
| 130 } | 129 } |
| 131 | 130 |
| 132 } // namespace ash | 131 } // namespace ash |
| OLD | NEW |