| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/date/date_default_view.h" | 8 #include "ash/system/date/date_default_view.h" |
| 9 #include "ash/system/date/date_view.h" | 9 #include "ash/system/date/date_view.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| 11 #include "ash/system/tray/system_tray_notifier.h" | 11 #include "ash/system/tray/system_tray_notifier.h" |
| 12 #include "ash/system/tray/tray_item_view.h" | 12 #include "ash/system/tray/tray_item_view.h" |
| 13 | 13 |
| 14 #if defined(OS_CHROMEOS) | 14 #if defined(OS_CHROMEOS) |
| 15 #include "ash/system/chromeos/system_clock_observer.h" | 15 #include "ash/system/chromeos/system_clock_observer.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace ash { | 18 namespace ash { |
| 19 namespace internal { | |
| 20 | 19 |
| 21 TrayDate::TrayDate(SystemTray* system_tray) | 20 TrayDate::TrayDate(SystemTray* system_tray) |
| 22 : SystemTrayItem(system_tray), | 21 : SystemTrayItem(system_tray), |
| 23 time_tray_(NULL), | 22 time_tray_(NULL), |
| 24 default_view_(NULL) { | 23 default_view_(NULL) { |
| 25 #if defined(OS_CHROMEOS) | 24 #if defined(OS_CHROMEOS) |
| 26 system_clock_observer_.reset(new SystemClockObserver()); | 25 system_clock_observer_.reset(new SystemClockObserver()); |
| 27 #endif | 26 #endif |
| 28 Shell::GetInstance()->system_tray_notifier()->AddClockObserver(this); | 27 Shell::GetInstance()->system_tray_notifier()->AddClockObserver(this); |
| 29 } | 28 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 time_tray_->UpdateTimeFormat(); | 105 time_tray_->UpdateTimeFormat(); |
| 107 if (default_view_) | 106 if (default_view_) |
| 108 default_view_->GetDateView()->UpdateTimeFormat(); | 107 default_view_->GetDateView()->UpdateTimeFormat(); |
| 109 } | 108 } |
| 110 | 109 |
| 111 void TrayDate::Refresh() { | 110 void TrayDate::Refresh() { |
| 112 if (time_tray_) | 111 if (time_tray_) |
| 113 time_tray_->UpdateText(); | 112 time_tray_->UpdateText(); |
| 114 } | 113 } |
| 115 | 114 |
| 116 } // namespace internal | |
| 117 } // namespace ash | 115 } // namespace ash |
| OLD | NEW |