| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_COMMON_SESSION_SESSION_STATE_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SESSION_SESSION_STATE_DELEGATE_H_ |
| 6 #define ASH_COMMON_SESSION_SESSION_STATE_DELEGATE_H_ | 6 #define ASH_COMMON_SESSION_SESSION_STATE_DELEGATE_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 "components/session_manager/session_manager_types.h" |
| 10 | 11 |
| 11 class AccountId; | 12 class AccountId; |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class ImageSkia; | 15 class ImageSkia; |
| 15 } | 16 } |
| 16 | 17 |
| 17 namespace user_manager { | 18 namespace user_manager { |
| 18 class UserInfo; | 19 class UserInfo; |
| 19 } | 20 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 31 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. | 32 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. |
| 32 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. | 33 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 enum AddUserError { | 36 enum AddUserError { |
| 36 ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER = 0, | 37 ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER = 0, |
| 37 ADD_USER_ERROR_OUT_OF_USERS, | 38 ADD_USER_ERROR_OUT_OF_USERS, |
| 38 ADD_USER_ERROR_MAXIMUM_USERS_REACHED, | 39 ADD_USER_ERROR_MAXIMUM_USERS_REACHED, |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 // Defines session state i.e. whether session is running or not and | |
| 42 // whether user session is blocked by things like multi-profile login. | |
| 43 enum SessionState { | |
| 44 // When primary user login UI is shown i.e. after boot or sign out, | |
| 45 // no active user session exists yet. | |
| 46 SESSION_STATE_LOGIN_PRIMARY = 0, | |
| 47 | |
| 48 // Inside user session (including lock screen), | |
| 49 // no login UI (primary or multi-profiles) is shown. | |
| 50 SESSION_STATE_ACTIVE, | |
| 51 | |
| 52 // When secondary user login UI is shown i.e. other users are | |
| 53 // already logged in and is currently adding another user to the session. | |
| 54 SESSION_STATE_LOGIN_SECONDARY, | |
| 55 }; | |
| 56 | |
| 57 virtual ~SessionStateDelegate() {} | 42 virtual ~SessionStateDelegate() {} |
| 58 | 43 |
| 59 // Returns the maximum possible number of logged in users. | 44 // Returns the maximum possible number of logged in users. |
| 60 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; | 45 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; |
| 61 | 46 |
| 62 // Returns the number of signed in users. If 0 is returned, there is either | 47 // Returns the number of signed in users. If 0 is returned, there is either |
| 63 // no session in progress or no active user. | 48 // no session in progress or no active user. |
| 64 virtual int NumberOfLoggedInUsers() const = 0; | 49 virtual int NumberOfLoggedInUsers() const = 0; |
| 65 | 50 |
| 66 // Returns true if there is possible to add more users to multiprofile | 51 // Returns true if there is possible to add more users to multiprofile |
| (...skipping 22 matching lines...) Expand all Loading... |
| 89 | 74 |
| 90 // Unlocks the screen. | 75 // Unlocks the screen. |
| 91 virtual void UnlockScreen() = 0; | 76 virtual void UnlockScreen() = 0; |
| 92 | 77 |
| 93 // Returns |true| if user session blocked by some overlying UI. It can be | 78 // Returns |true| if user session blocked by some overlying UI. It can be |
| 94 // login screen, lock screen or screen for adding users into multi-profile | 79 // login screen, lock screen or screen for adding users into multi-profile |
| 95 // session. | 80 // session. |
| 96 virtual bool IsUserSessionBlocked() const = 0; | 81 virtual bool IsUserSessionBlocked() const = 0; |
| 97 | 82 |
| 98 // Returns current session state. | 83 // Returns current session state. |
| 99 virtual SessionState GetSessionState() const = 0; | 84 virtual session_manager::SessionState GetSessionState() const = 0; |
| 100 | 85 |
| 101 // Gets the user info for the user with the given |index|. See session_types.h | 86 // Gets the user info for the user with the given |index|. See session_types.h |
| 102 // for a description of UserIndex. | 87 // for a description of UserIndex. |
| 103 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | 88 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. |
| 104 virtual const user_manager::UserInfo* GetUserInfo(UserIndex index) const = 0; | 89 virtual const user_manager::UserInfo* GetUserInfo(UserIndex index) const = 0; |
| 105 | 90 |
| 106 // Whether or not the window's title should show the avatar. | 91 // Whether or not the window's title should show the avatar. |
| 107 virtual bool ShouldShowAvatar(WmWindow* window) const = 0; | 92 virtual bool ShouldShowAvatar(WmWindow* window) const = 0; |
| 108 | 93 |
| 109 // Returns the avatar image for the specified window. | 94 // Returns the avatar image for the specified window. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 123 // Adds or removes sessions state observer. | 108 // Adds or removes sessions state observer. |
| 124 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; | 109 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; |
| 125 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; | 110 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; |
| 126 | 111 |
| 127 bool IsInSecondaryLoginScreen() const; | 112 bool IsInSecondaryLoginScreen() const; |
| 128 }; | 113 }; |
| 129 | 114 |
| 130 } // namespace ash | 115 } // namespace ash |
| 131 | 116 |
| 132 #endif // ASH_COMMON_SESSION_SESSION_STATE_DELEGATE_H_ | 117 #endif // ASH_COMMON_SESSION_SESSION_STATE_DELEGATE_H_ |
| OLD | NEW |