Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: ash/system/date/tray_date.cc

Issue 23112002: Fixing the gdrive sync item alignment to keep it centered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/system/tray/tray_item_view.h » ('j') | ash/system/tray/tray_item_view.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/tray_item_view.h » ('j') | ash/system/tray/tray_item_view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698