| 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/date/date_default_view.h" | 8 #include "ash/common/system/date/date_default_view.h" |
| 9 #include "ash/common/system/date/date_view.h" | 9 #include "ash/common/system/date/date_view.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 system_tray()->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM | 57 system_tray()->shelf_alignment() == 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(LoginStatus status) { | 66 views::View* TrayDate::CreateDefaultView(LoginStatus status) { |
| 67 default_view_ = new DateDefaultView(status); | 67 default_view_ = new DateDefaultView(this, status); |
| 68 | 68 |
| 69 #if defined(OS_CHROMEOS) | 69 #if defined(OS_CHROMEOS) |
| 70 // Save the login status we created the view with. | 70 // Save the login status we created the view with. |
| 71 login_status_ = status; | 71 login_status_ = status; |
| 72 | 72 |
| 73 OnSystemClockCanSetTimeChanged(system_clock_observer_->can_set_time()); | 73 OnSystemClockCanSetTimeChanged(system_clock_observer_->can_set_time()); |
| 74 #endif | 74 #endif |
| 75 return default_view_; | 75 return default_view_; |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); | 121 can_set_time ? TrayDate::SET_SYSTEM_TIME : TrayDate::NONE); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 void TrayDate::Refresh() { | 125 void TrayDate::Refresh() { |
| 126 if (time_tray_) | 126 if (time_tray_) |
| 127 time_tray_->UpdateText(); | 127 time_tray_->UpdateText(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace ash | 130 } // namespace ash |
| OLD | NEW |