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 #ifndef ASH_SYSTEM_USER_TRAY_USER_H_ | 5 #ifndef ASH_SYSTEM_USER_TRAY_USER_H_ |
6 #define ASH_SYSTEM_USER_TRAY_USER_H_ | 6 #define ASH_SYSTEM_USER_TRAY_USER_H_ |
7 | 7 |
| 8 #include "ash/session_state_delegate.h" |
8 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
9 #include "ash/system/user/user_observer.h" | 10 #include "ash/system/user/user_observer.h" |
10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
11 | 12 |
12 namespace views { | 13 namespace views { |
13 class ImageView; | 14 class ImageView; |
14 class Label; | 15 class Label; |
15 } | 16 } |
16 | 17 |
17 namespace ash { | 18 namespace ash { |
18 namespace internal { | 19 namespace internal { |
19 | 20 |
20 namespace tray { | 21 namespace tray { |
21 class UserView; | 22 class UserView; |
22 class RoundedImageView; | 23 class RoundedImageView; |
23 } | 24 } |
24 | 25 |
25 class TrayUser : public SystemTrayItem, | 26 class TrayUser : public SystemTrayItem, |
26 public UserObserver { | 27 public UserObserver { |
27 public: | 28 public: |
28 explicit TrayUser(SystemTray* system_tray); | 29 // The given |multiprofile_index| is the number of the user in a multi profile |
| 30 // scenario. Index #0 is the running user, the other indices are other |
| 31 // logged in users (if there are any). Only index #0 will add an icon to |
| 32 // the system tray. |
| 33 TrayUser(SystemTray* system_tray, MultiProfileIndex index); |
29 virtual ~TrayUser(); | 34 virtual ~TrayUser(); |
30 | 35 |
31 private: | 36 private: |
32 // Overridden from SystemTrayItem. | 37 // Overridden from SystemTrayItem. |
33 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 38 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
34 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 39 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
35 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 40 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
36 virtual void DestroyTrayView() OVERRIDE; | 41 virtual void DestroyTrayView() OVERRIDE; |
37 virtual void DestroyDefaultView() OVERRIDE; | 42 virtual void DestroyDefaultView() OVERRIDE; |
38 virtual void DestroyDetailedView() OVERRIDE; | 43 virtual void DestroyDetailedView() OVERRIDE; |
39 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 44 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
40 virtual void UpdateAfterShelfAlignmentChange( | 45 virtual void UpdateAfterShelfAlignmentChange( |
41 ShelfAlignment alignment) OVERRIDE; | 46 ShelfAlignment alignment) OVERRIDE; |
42 | 47 |
43 // Overridden from UserObserver. | 48 // Overridden from UserObserver. |
44 virtual void OnUserUpdate() OVERRIDE; | 49 virtual void OnUserUpdate() OVERRIDE; |
45 | 50 |
| 51 // The user index to use. |
| 52 MultiProfileIndex multiprofile_index_; |
| 53 |
46 tray::UserView* user_; | 54 tray::UserView* user_; |
47 | 55 |
48 // View that contains label and/or avatar. | 56 // View that contains label and/or avatar. |
49 views::View* layout_view_; | 57 views::View* layout_view_; |
50 tray::RoundedImageView* avatar_; | 58 tray::RoundedImageView* avatar_; |
51 views::Label* label_; | 59 views::Label* label_; |
52 | 60 |
53 DISALLOW_COPY_AND_ASSIGN(TrayUser); | 61 DISALLOW_COPY_AND_ASSIGN(TrayUser); |
54 }; | 62 }; |
55 | 63 |
56 } // namespace internal | 64 } // namespace internal |
57 } // namespace ash | 65 } // namespace ash |
58 | 66 |
59 #endif // ASH_SYSTEM_USER_TRAY_USER_H_ | 67 #endif // ASH_SYSTEM_USER_TRAY_USER_H_ |
OLD | NEW |