Chromium Code Reviews| 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/session_state_delegate.h" | 7 #include "ash/session_state_delegate.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/system/date/date_view.h" | 10 #include "ash/system/date/date_view.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 148 Shell::GetInstance()->system_tray_notifier()->RemoveClockObserver(this); | 148 Shell::GetInstance()->system_tray_notifier()->RemoveClockObserver(this); |
| 149 } | 149 } |
| 150 | 150 |
| 151 views::View* TrayDate::CreateTrayView(user::LoginStatus status) { | 151 views::View* TrayDate::CreateTrayView(user::LoginStatus status) { |
| 152 CHECK(time_tray_ == NULL); | 152 CHECK(time_tray_ == NULL); |
| 153 ClockLayout clock_layout = | 153 ClockLayout clock_layout = |
| 154 (system_tray()->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM || | 154 (system_tray()->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM || |
| 155 system_tray()->shelf_alignment() == SHELF_ALIGNMENT_TOP) ? | 155 system_tray()->shelf_alignment() == SHELF_ALIGNMENT_TOP) ? |
| 156 HORIZONTAL_CLOCK : VERTICAL_CLOCK; | 156 HORIZONTAL_CLOCK : VERTICAL_CLOCK; |
| 157 time_tray_ = new tray::TimeView(clock_layout); | 157 time_tray_ = new tray::TimeView(clock_layout); |
| 158 views::View* view = new TrayItemView(this); | 158 TrayItemView* view = new TrayItemView(this); |
| 159 // Our text needs always to be aligned horizontally - no matter what the | |
| 160 // shelf does. | |
| 161 view->SetAlignmentOverride(TrayItemView::HORIZONTAL); | |
|
jennyz
2013/08/13 20:32:51
You can put the fix in TrayDate:::UpdateAfterShelf
Mr4D (OOO till 08-26)
2013/08/13 21:25:01
Actually - this was not about the date, but the Dr
| |
| 159 view->AddChildView(time_tray_); | 162 view->AddChildView(time_tray_); |
| 160 return view; | 163 return view; |
| 161 } | 164 } |
| 162 | 165 |
| 163 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) { | 166 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) { |
| 164 return new DateDefaultView(status); | 167 return new DateDefaultView(status); |
| 165 } | 168 } |
| 166 | 169 |
| 167 views::View* TrayDate::CreateDetailedView(user::LoginStatus status) { | 170 views::View* TrayDate::CreateDetailedView(user::LoginStatus status) { |
| 168 return NULL; | 171 return NULL; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 200 time_tray_->UpdateTimeFormat(); | 203 time_tray_->UpdateTimeFormat(); |
| 201 } | 204 } |
| 202 | 205 |
| 203 void TrayDate::Refresh() { | 206 void TrayDate::Refresh() { |
| 204 if (time_tray_) | 207 if (time_tray_) |
| 205 time_tray_->UpdateText(); | 208 time_tray_->UpdateText(); |
| 206 } | 209 } |
| 207 | 210 |
| 208 } // namespace internal | 211 } // namespace internal |
| 209 } // namespace ash | 212 } // namespace ash |
| OLD | NEW |