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/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
9 #include "ash/common/shelf/wm_shelf_util.h" | 9 #include "ash/common/shelf/wm_shelf_util.h" |
10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 const int kUserLabelToIconPadding = 5; | 34 const int kUserLabelToIconPadding = 5; |
35 | 35 |
36 } // namespace | 36 } // namespace |
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), | 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 WmShell::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 WmShell::Get()->system_tray_notifier()->RemoveUserObserver(this); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // Unit tests might come here with no images for some users. | 262 // Unit tests might come here with no images for some users. |
263 if (avatar_->size().IsEmpty()) | 263 if (avatar_->size().IsEmpty()) |
264 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize)); | 264 avatar_->SetSize(gfx::Size(kTrayItemSize, kTrayItemSize)); |
265 } | 265 } |
266 | 266 |
267 void TrayUser::UpdateLayoutOfItem() { | 267 void TrayUser::UpdateLayoutOfItem() { |
268 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment()); | 268 UpdateAfterShelfAlignmentChange(system_tray()->shelf_alignment()); |
269 } | 269 } |
270 | 270 |
271 } // namespace ash | 271 } // namespace ash |
OLD | NEW |