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/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/common/session/session_types.h" | 9 #include "ash/common/session/session_types.h" |
10 #include "ash/common/system/tray/system_tray_item.h" | 10 #include "ash/common/system/tray/system_tray_item.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class Label; | 21 class Label; |
22 } | 22 } |
23 | 23 |
24 namespace ash { | 24 namespace ash { |
25 | 25 |
26 namespace tray { | 26 namespace tray { |
27 class RoundedImageView; | 27 class RoundedImageView; |
28 class UserView; | 28 class UserView; |
29 } | 29 } |
30 | 30 |
31 class ASH_EXPORT TrayUser : public SystemTrayItem, | 31 class ASH_EXPORT TrayUser : public SystemTrayItem, public UserObserver { |
32 public UserObserver { | |
33 public: | 32 public: |
34 // The given |index| is the user index in a multi profile scenario. Index #0 | 33 // The given |index| is the user index in a multi profile scenario. Index #0 |
35 // is the active user, the other indices are other logged in users (if there | 34 // is the active user, the other indices are other logged in users (if there |
36 // are any). Depending on the multi user mode, there will be either one (index | 35 // are any). Depending on the multi user mode, there will be either one (index |
37 // #0) or all users be visible in the system tray. | 36 // #0) or all users be visible in the system tray. |
38 TrayUser(SystemTray* system_tray, UserIndex index); | 37 TrayUser(SystemTray* system_tray, UserIndex index); |
39 ~TrayUser() override; | 38 ~TrayUser() override; |
40 | 39 |
41 // Allows unit tests to see if the item was created. | 40 // Allows unit tests to see if the item was created. |
42 enum TestState { | 41 enum TestState { |
43 HIDDEN, // The item is hidden. | 42 HIDDEN, // The item is hidden. |
44 SHOWN, // The item gets presented to the user. | 43 SHOWN, // The item gets presented to the user. |
45 HOVERED, // The item is hovered and presented to the user. | 44 HOVERED, // The item is hovered and presented to the user. |
46 ACTIVE, // The item was clicked and can add a user. | 45 ACTIVE, // The item was clicked and can add a user. |
47 ACTIVE_BUT_DISABLED // The item was clicked anc cannot add a user. | 46 ACTIVE_BUT_DISABLED // The item was clicked anc cannot add a user. |
48 }; | 47 }; |
49 TestState GetStateForTest() const; | 48 TestState GetStateForTest() const; |
50 | 49 |
51 // Returns the size of layout_view_. | 50 // Returns the size of layout_view_. |
52 gfx::Size GetLayoutSizeForTest() const; | 51 gfx::Size GetLayoutSizeForTest() const; |
53 | 52 |
54 // Returns the bounds of the user panel in screen coordinates. | 53 // Returns the bounds of the user panel in screen coordinates. |
55 // Note: This only works when the panel shown. | 54 // Note: This only works when the panel shown. |
56 gfx::Rect GetUserPanelBoundsInScreenForTest() const; | 55 gfx::Rect GetUserPanelBoundsInScreenForTest() const; |
57 | 56 |
(...skipping 30 matching lines...) Expand all Loading... |
88 views::View* layout_view_; | 87 views::View* layout_view_; |
89 tray::RoundedImageView* avatar_; | 88 tray::RoundedImageView* avatar_; |
90 views::Label* label_; | 89 views::Label* label_; |
91 | 90 |
92 DISALLOW_COPY_AND_ASSIGN(TrayUser); | 91 DISALLOW_COPY_AND_ASSIGN(TrayUser); |
93 }; | 92 }; |
94 | 93 |
95 } // namespace ash | 94 } // namespace ash |
96 | 95 |
97 #endif // ASH_SYSTEM_USER_TRAY_USER_H_ | 96 #endif // ASH_SYSTEM_USER_TRAY_USER_H_ |
OLD | NEW |