| 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/shelf/shelf_util.h" | 7 #include "ash/shelf/shelf_util.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/date/date_default_view.h" | 9 #include "ash/system/date/date_default_view.h" |
| 10 #include "ash/system/date/date_view.h" | 10 #include "ash/system/date/date_view.h" |
| 11 #include "ash/system/tray/system_tray.h" | 11 #include "ash/system/tray/system_tray.h" |
| 12 #include "ash/system/tray/system_tray_notifier.h" | 12 #include "ash/system/tray/system_tray_notifier.h" |
| 13 #include "ash/system/tray/tray_item_view.h" | 13 #include "ash/system/tray/tray_item_view.h" |
| 14 #include "ash/wm/common/shelf/wm_shelf_util.h" |
| 14 | 15 |
| 15 #if defined(OS_CHROMEOS) | 16 #if defined(OS_CHROMEOS) |
| 16 #include "ash/system/chromeos/system_clock_observer.h" | 17 #include "ash/system/chromeos/system_clock_observer.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| 19 namespace ash { | 20 namespace ash { |
| 20 | 21 |
| 21 TrayDate::TrayDate(SystemTray* system_tray) | 22 TrayDate::TrayDate(SystemTray* system_tray) |
| 22 : SystemTrayItem(system_tray), | 23 : SystemTrayItem(system_tray), |
| 23 time_tray_(NULL), | 24 time_tray_(NULL), |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 89 } |
| 89 | 90 |
| 90 void TrayDate::DestroyDetailedView() { | 91 void TrayDate::DestroyDetailedView() { |
| 91 } | 92 } |
| 92 | 93 |
| 93 void TrayDate::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 94 void TrayDate::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 94 } | 95 } |
| 95 | 96 |
| 96 void TrayDate::UpdateAfterShelfAlignmentChange(wm::ShelfAlignment alignment) { | 97 void TrayDate::UpdateAfterShelfAlignmentChange(wm::ShelfAlignment alignment) { |
| 97 if (time_tray_) { | 98 if (time_tray_) { |
| 98 ClockLayout clock_layout = | 99 ClockLayout clock_layout = wm::IsHorizontalAlignment(alignment) |
| 99 IsHorizontalAlignment(alignment) ? HORIZONTAL_CLOCK : VERTICAL_CLOCK; | 100 ? HORIZONTAL_CLOCK |
| 101 : VERTICAL_CLOCK; |
| 100 time_tray_->UpdateClockLayout(clock_layout); | 102 time_tray_->UpdateClockLayout(clock_layout); |
| 101 } | 103 } |
| 102 } | 104 } |
| 103 | 105 |
| 104 void TrayDate::OnDateFormatChanged() { | 106 void TrayDate::OnDateFormatChanged() { |
| 105 if (time_tray_) | 107 if (time_tray_) |
| 106 time_tray_->UpdateTimeFormat(); | 108 time_tray_->UpdateTimeFormat(); |
| 107 if (default_view_) | 109 if (default_view_) |
| 108 default_view_->GetDateView()->UpdateTimeFormat(); | 110 default_view_->GetDateView()->UpdateTimeFormat(); |
| 109 } | 111 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 123 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); | 125 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); |
| 124 } | 126 } |
| 125 } | 127 } |
| 126 | 128 |
| 127 void TrayDate::Refresh() { | 129 void TrayDate::Refresh() { |
| 128 if (time_tray_) | 130 if (time_tray_) |
| 129 time_tray_->UpdateText(); | 131 time_tray_->UpdateText(); |
| 130 } | 132 } |
| 131 | 133 |
| 132 } // namespace ash | 134 } // namespace ash |
| OLD | NEW |