| 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/user/tray_user.h" | 5 #include "ash/common/system/user/tray_user.h" |
| 6 | 6 |
| 7 #include "ash/common/session/session_controller.h" | 7 #include "ash/common/session/session_controller.h" |
| 8 #include "ash/common/shelf/wm_shelf_util.h" | 8 #include "ash/common/shelf/wm_shelf_util.h" |
| 9 #include "ash/common/system/tray/system_tray.h" | 9 #include "ash/common/system/tray/system_tray.h" |
| 10 #include "ash/common/system/tray/system_tray_delegate.h" | 10 #include "ash/common/system/tray/system_tray_delegate.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace ash { | 38 namespace ash { |
| 39 | 39 |
| 40 TrayUser::TrayUser(SystemTray* system_tray, UserIndex index) | 40 TrayUser::TrayUser(SystemTray* system_tray, UserIndex index) |
| 41 : SystemTrayItem(system_tray, UMA_USER), | 41 : SystemTrayItem(system_tray, UMA_USER), |
| 42 user_index_(index), | 42 user_index_(index), |
| 43 user_(nullptr), | 43 user_(nullptr), |
| 44 layout_view_(nullptr), | 44 layout_view_(nullptr), |
| 45 avatar_(nullptr), | 45 avatar_(nullptr), |
| 46 label_(nullptr) { | 46 label_(nullptr) { |
| 47 WmShell::Get()->system_tray_notifier()->AddUserObserver(this); | 47 Shell::Get()->system_tray_notifier()->AddUserObserver(this); |
| 48 } | 48 } |
| 49 | 49 |
| 50 TrayUser::~TrayUser() { | 50 TrayUser::~TrayUser() { |
| 51 WmShell::Get()->system_tray_notifier()->RemoveUserObserver(this); | 51 Shell::Get()->system_tray_notifier()->RemoveUserObserver(this); |
| 52 } | 52 } |
| 53 | 53 |
| 54 TrayUser::TestState TrayUser::GetStateForTest() const { | 54 TrayUser::TestState TrayUser::GetStateForTest() const { |
| 55 if (!user_) | 55 if (!user_) |
| 56 return HIDDEN; | 56 return HIDDEN; |
| 57 return user_->GetStateForTest(); | 57 return user_->GetStateForTest(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 gfx::Size TrayUser::GetLayoutSizeForTest() const { | 60 gfx::Size TrayUser::GetLayoutSizeForTest() const { |
| 61 return layout_view_ ? layout_view_->size() : gfx::Size(); | 61 return layout_view_ ? layout_view_->size() : gfx::Size(); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // Unit tests might come here with no images for some users. | 252 // Unit tests might come here with no images for some users. |
| 253 if (avatar_->size().IsEmpty()) | 253 if (avatar_->size().IsEmpty()) |
| 254 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize)); | 254 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize)); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void TrayUser::UpdateLayoutOfItem() { | 257 void TrayUser::UpdateLayoutOfItem() { |
| 258 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment()); | 258 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 } // namespace ash | 261 } // namespace ash |
| OLD | NEW |