| 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" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 return default_view_; | 47 return default_view_; |
| 48 } | 48 } |
| 49 | 49 |
| 50 views::View* TrayDate::CreateDefaultViewForTesting(user::LoginStatus status) { | 50 views::View* TrayDate::CreateDefaultViewForTesting(user::LoginStatus status) { |
| 51 return CreateDefaultView(status); | 51 return CreateDefaultView(status); |
| 52 } | 52 } |
| 53 | 53 |
| 54 views::View* TrayDate::CreateTrayView(user::LoginStatus status) { | 54 views::View* TrayDate::CreateTrayView(user::LoginStatus status) { |
| 55 CHECK(time_tray_ == NULL); | 55 CHECK(time_tray_ == NULL); |
| 56 ClockLayout clock_layout = | 56 ClockLayout clock_layout = |
| 57 system_tray()->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM | 57 system_tray()->shelf_alignment() == wm::SHELF_ALIGNMENT_BOTTOM |
| 58 ? HORIZONTAL_CLOCK | 58 ? HORIZONTAL_CLOCK |
| 59 : VERTICAL_CLOCK; | 59 : VERTICAL_CLOCK; |
| 60 time_tray_ = new tray::TimeView(clock_layout); | 60 time_tray_ = new tray::TimeView(clock_layout); |
| 61 views::View* view = new TrayItemView(this); | 61 views::View* view = new TrayItemView(this); |
| 62 view->AddChildView(time_tray_); | 62 view->AddChildView(time_tray_); |
| 63 return view; | 63 return view; |
| 64 } | 64 } |
| 65 | 65 |
| 66 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) { | 66 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) { |
| 67 default_view_ = new DateDefaultView(status); | 67 default_view_ = new DateDefaultView(status); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 86 void TrayDate::DestroyDefaultView() { | 86 void TrayDate::DestroyDefaultView() { |
| 87 default_view_ = NULL; | 87 default_view_ = NULL; |
| 88 } | 88 } |
| 89 | 89 |
| 90 void TrayDate::DestroyDetailedView() { | 90 void TrayDate::DestroyDetailedView() { |
| 91 } | 91 } |
| 92 | 92 |
| 93 void TrayDate::UpdateAfterLoginStatusChange(user::LoginStatus status) { | 93 void TrayDate::UpdateAfterLoginStatusChange(user::LoginStatus status) { |
| 94 } | 94 } |
| 95 | 95 |
| 96 void TrayDate::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { | 96 void TrayDate::UpdateAfterShelfAlignmentChange(wm::ShelfAlignment alignment) { |
| 97 if (time_tray_) { | 97 if (time_tray_) { |
| 98 ClockLayout clock_layout = | 98 ClockLayout clock_layout = |
| 99 IsHorizontalAlignment(alignment) ? HORIZONTAL_CLOCK : VERTICAL_CLOCK; | 99 IsHorizontalAlignment(alignment) ? HORIZONTAL_CLOCK : VERTICAL_CLOCK; |
| 100 time_tray_->UpdateClockLayout(clock_layout); | 100 time_tray_->UpdateClockLayout(clock_layout); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 void TrayDate::OnDateFormatChanged() { | 104 void TrayDate::OnDateFormatChanged() { |
| 105 if (time_tray_) | 105 if (time_tray_) |
| 106 time_tray_->UpdateTimeFormat(); | 106 time_tray_->UpdateTimeFormat(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 123 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); | 123 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void TrayDate::Refresh() { | 127 void TrayDate::Refresh() { |
| 128 if (time_tray_) | 128 if (time_tray_) |
| 129 time_tray_->UpdateText(); | 129 time_tray_->UpdateText(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } // namespace ash | 132 } // namespace ash |
| OLD | NEW |