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

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

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix single-letter typo :(. Created 8 years, 1 month 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 | « ash/system/date/tray_date.h ('k') | ash/system/drive/tray_drive.h » ('j') | no next file with comments »
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/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/date/date_view.h" 8 #include "ash/system/date/date_view.h"
9 #include "ash/system/tray/system_tray.h" 9 #include "ash/system/tray/system_tray.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ash::internal::TrayPopupHeaderButton* lock_; 117 ash::internal::TrayPopupHeaderButton* lock_;
118 118
119 DISALLOW_COPY_AND_ASSIGN(DateDefaultView); 119 DISALLOW_COPY_AND_ASSIGN(DateDefaultView);
120 }; 120 };
121 121
122 } // namespace 122 } // namespace
123 123
124 namespace ash { 124 namespace ash {
125 namespace internal { 125 namespace internal {
126 126
127 TrayDate::TrayDate() 127 TrayDate::TrayDate(SystemTray* system_tray)
128 : time_tray_(NULL) { 128 : SystemTrayItem(system_tray),
129 time_tray_(NULL) {
129 } 130 }
130 131
131 TrayDate::~TrayDate() { 132 TrayDate::~TrayDate() {
132 } 133 }
133 134
134 views::View* TrayDate::CreateTrayView(user::LoginStatus status) { 135 views::View* TrayDate::CreateTrayView(user::LoginStatus status) {
135 CHECK(time_tray_ == NULL); 136 CHECK(time_tray_ == NULL);
136 ClockLayout clock_layout = 137 ClockLayout clock_layout =
137 ash::Shell::GetInstance()->system_tray()->shelf_alignment() == 138 system_tray()->shelf_alignment() == SHELF_ALIGNMENT_BOTTOM ?
138 SHELF_ALIGNMENT_BOTTOM ? 139 HORIZONTAL_CLOCK : VERTICAL_CLOCK;
139 HORIZONTAL_CLOCK : VERTICAL_CLOCK;
140 time_tray_ = new tray::TimeView(clock_layout); 140 time_tray_ = new tray::TimeView(clock_layout);
141 views::View* view = new TrayItemView; 141 views::View* view = new TrayItemView(this);
142 view->AddChildView(time_tray_); 142 view->AddChildView(time_tray_);
143 return view; 143 return view;
144 } 144 }
145 145
146 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) { 146 views::View* TrayDate::CreateDefaultView(user::LoginStatus status) {
147 return new DateDefaultView(status); 147 return new DateDefaultView(status);
148 } 148 }
149 149
150 views::View* TrayDate::CreateDetailedView(user::LoginStatus status) { 150 views::View* TrayDate::CreateDetailedView(user::LoginStatus status) {
151 return NULL; 151 return NULL;
(...skipping 25 matching lines...) Expand all
177 time_tray_->UpdateTimeFormat(); 177 time_tray_->UpdateTimeFormat();
178 } 178 }
179 179
180 void TrayDate::Refresh() { 180 void TrayDate::Refresh() {
181 if (time_tray_) 181 if (time_tray_)
182 time_tray_->UpdateText(); 182 time_tray_->UpdateText();
183 } 183 }
184 184
185 } // namespace internal 185 } // namespace internal
186 } // namespace ash 186 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/date/tray_date.h ('k') | ash/system/drive/tray_drive.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698