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/user/tray_user.h" | 5 #include "ash/system/user/tray_user.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "ash/system/tray/tray_item_view.h" | 10 #include "ash/system/tray/tray_item_view.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 views::Label* username_; | 232 views::Label* username_; |
233 views::Label* email_; | 233 views::Label* email_; |
234 | 234 |
235 views::Button* signout_; | 235 views::Button* signout_; |
236 | 236 |
237 DISALLOW_COPY_AND_ASSIGN(UserView); | 237 DISALLOW_COPY_AND_ASSIGN(UserView); |
238 }; | 238 }; |
239 | 239 |
240 } // namespace tray | 240 } // namespace tray |
241 | 241 |
242 TrayUser::TrayUser() | 242 TrayUser::TrayUser(SystemTray* system_tray) |
243 : user_(NULL), | 243 : SystemTrayItem(system_tray), |
| 244 user_(NULL), |
244 avatar_(NULL), | 245 avatar_(NULL), |
245 label_(NULL) { | 246 label_(NULL) { |
246 } | 247 } |
247 | 248 |
248 TrayUser::~TrayUser() { | 249 TrayUser::~TrayUser() { |
249 } | 250 } |
250 | 251 |
251 views::View* TrayUser::CreateTrayView(user::LoginStatus status) { | 252 views::View* TrayUser::CreateTrayView(user::LoginStatus status) { |
252 CHECK(avatar_ == NULL); | 253 CHECK(avatar_ == NULL); |
253 CHECK(label_ == NULL); | 254 CHECK(label_ == NULL); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // Check for null to avoid crbug.com/150944. | 341 // Check for null to avoid crbug.com/150944. |
341 if (avatar_) { | 342 if (avatar_) { |
342 avatar_->SetImage( | 343 avatar_->SetImage( |
343 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), | 344 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), |
344 gfx::Size(kUserIconSize, kUserIconSize)); | 345 gfx::Size(kUserIconSize, kUserIconSize)); |
345 } | 346 } |
346 } | 347 } |
347 | 348 |
348 } // namespace internal | 349 } // namespace internal |
349 } // namespace ash | 350 } // namespace ash |
OLD | NEW |