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/system/tray/system_tray_item.h" | 8 #include "ash/system/tray/system_tray_item.h" |
9 #include "ash/system/user/user_observer.h" | 9 #include "ash/system/user/user_observer.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 class ImageView; | 12 class ImageView; |
13 class Label; | 13 class Label; |
14 } | 14 } |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
| 17 |
| 18 class SystemTray; |
| 19 |
17 namespace internal { | 20 namespace internal { |
18 | 21 |
19 namespace tray { | 22 namespace tray { |
20 class UserView; | 23 class UserView; |
21 class RoundedImageView; | 24 class RoundedImageView; |
22 } | 25 } |
23 | 26 |
24 class TrayUser : public SystemTrayItem, | 27 class TrayUser : public SystemTrayItem, |
25 public UserObserver { | 28 public UserObserver { |
26 public: | 29 public: |
27 TrayUser(); | 30 explicit TrayUser(SystemTray* system_tray); |
28 virtual ~TrayUser(); | 31 virtual ~TrayUser(); |
29 | 32 |
30 private: | 33 private: |
31 // Overridden from SystemTrayItem | 34 // Overridden from SystemTrayItem |
32 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 35 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
33 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 36 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
34 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 37 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
35 virtual void DestroyTrayView() OVERRIDE; | 38 virtual void DestroyTrayView() OVERRIDE; |
36 virtual void DestroyDefaultView() OVERRIDE; | 39 virtual void DestroyDefaultView() OVERRIDE; |
37 virtual void DestroyDetailedView() OVERRIDE; | 40 virtual void DestroyDetailedView() OVERRIDE; |
38 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 41 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
39 virtual void UpdateAfterShelfAlignmentChange( | 42 virtual void UpdateAfterShelfAlignmentChange( |
40 ShelfAlignment alignment) OVERRIDE; | 43 ShelfAlignment alignment) OVERRIDE; |
41 | 44 |
42 // Overridden from UserObserver. | 45 // Overridden from UserObserver. |
43 virtual void OnUserUpdate() OVERRIDE; | 46 virtual void OnUserUpdate() OVERRIDE; |
44 | 47 |
45 tray::UserView* user_; | 48 tray::UserView* user_; |
46 tray::RoundedImageView* avatar_; | 49 tray::RoundedImageView* avatar_; |
47 views::Label* label_; | 50 views::Label* label_; |
48 | 51 |
49 DISALLOW_COPY_AND_ASSIGN(TrayUser); | 52 DISALLOW_COPY_AND_ASSIGN(TrayUser); |
50 }; | 53 }; |
51 | 54 |
52 } // namespace internal | 55 } // namespace internal |
53 } // namespace ash | 56 } // namespace ash |
54 | 57 |
55 #endif // ASH_SYSTEM_USER_TRAY_USER_H_ | 58 #endif // ASH_SYSTEM_USER_TRAY_USER_H_ |
OLD | NEW |