| 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 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. | 31 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. |
| 32 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. | 32 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 enum AddUserError { | 35 enum AddUserError { |
| 36 ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER = 0, | 36 ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER = 0, |
| 37 ADD_USER_ERROR_OUT_OF_USERS, | 37 ADD_USER_ERROR_OUT_OF_USERS, |
| 38 ADD_USER_ERROR_MAXIMUM_USERS_REACHED, | 38 ADD_USER_ERROR_MAXIMUM_USERS_REACHED, |
| 39 }; | 39 }; |
| 40 | 40 |
| 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() {} | 41 virtual ~SessionStateDelegate() {} |
| 58 | 42 |
| 59 // Returns the maximum possible number of logged in users. | 43 // Returns the maximum possible number of logged in users. |
| 60 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; | 44 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; |
| 61 | 45 |
| 62 // Returns the number of signed in users. If 0 is returned, there is either | 46 // Returns the number of signed in users. If 0 is returned, there is either |
| 63 // no session in progress or no active user. | 47 // no session in progress or no active user. |
| 64 virtual int NumberOfLoggedInUsers() const = 0; | 48 virtual int NumberOfLoggedInUsers() const = 0; |
| 65 | 49 |
| 66 // Returns true if there is possible to add more users to multiprofile | 50 // Returns true if there is possible to add more users to multiprofile |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // Adds or removes sessions state observer. | 107 // Adds or removes sessions state observer. |
| 124 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; | 108 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; |
| 125 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; | 109 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; |
| 126 | 110 |
| 127 bool IsInSecondaryLoginScreen() const; | 111 bool IsInSecondaryLoginScreen() const; |
| 128 }; | 112 }; |
| 129 | 113 |
| 130 } // namespace ash | 114 } // namespace ash |
| 131 | 115 |
| 132 #endif // ASH_COMMON_SESSION_SESSION_STATE_DELEGATE_H_ | 116 #endif // ASH_COMMON_SESSION_SESSION_STATE_DELEGATE_H_ |
| OLD | NEW |