Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SESSION_SESSION_STATE_DELEGATE_H_ | 5 #ifndef ASH_SESSION_SESSION_STATE_DELEGATE_H_ |
| 6 #define ASH_SESSION_SESSION_STATE_DELEGATE_H_ | 6 #define ASH_SESSION_SESSION_STATE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 // TODO(oshima): Replace MultiProfileIndex with BrowsreContext, bacause | 42 // TODO(oshima): Replace MultiProfileIndex with BrowsreContext, bacause |
| 43 // GetUserXXX are useful for non multi profile scenario in ash_shell. | 43 // GetUserXXX are useful for non multi profile scenario in ash_shell. |
| 44 class ASH_EXPORT SessionStateDelegate { | 44 class ASH_EXPORT SessionStateDelegate { |
| 45 public: | 45 public: |
| 46 // Defines the cycle direction for |CycleActiveUser|. | 46 // Defines the cycle direction for |CycleActiveUser|. |
| 47 enum CycleUser { | 47 enum CycleUser { |
| 48 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. | 48 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. |
| 49 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. | 49 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 enum MultiProfileAddUserError { | |
|
James Cook
2014/09/23 16:02:12
This is fine, but I would also be OK with a shorte
Roman Sorokin (ftl)
2014/09/24 08:30:47
Done.
| |
| 53 MULTIPROFILE_ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER = 0, | |
| 54 MULTIPROFILE_ADD_USER_ERROR_OUT_OF_USERS, | |
| 55 MULTIPROFILE_ADD_USER_ERROR_MAXIMUM_OF_USERS_REACHED, | |
|
James Cook
2014/09/23 16:02:12
nit: I would say _MAXIMUM_USERS_REACHED
Roman Sorokin (ftl)
2014/09/24 08:30:47
Done.
| |
| 56 }; | |
| 57 | |
| 52 // Defines session state i.e. whether session is running or not and | 58 // Defines session state i.e. whether session is running or not and |
| 53 // whether user session is blocked by things like multi-profile login. | 59 // whether user session is blocked by things like multi-profile login. |
| 54 enum SessionState { | 60 enum SessionState { |
| 55 // When primary user login UI is shown i.e. after boot or sign out, | 61 // When primary user login UI is shown i.e. after boot or sign out, |
| 56 // no active user session exists yet. | 62 // no active user session exists yet. |
| 57 SESSION_STATE_LOGIN_PRIMARY = 0, | 63 SESSION_STATE_LOGIN_PRIMARY = 0, |
| 58 | 64 |
| 59 // Inside user session (including lock screen), | 65 // Inside user session (including lock screen), |
| 60 // no login UI (primary or multi-profiles) is shown. | 66 // no login UI (primary or multi-profiles) is shown. |
| 61 SESSION_STATE_ACTIVE, | 67 SESSION_STATE_ACTIVE, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 75 virtual content::BrowserContext* GetBrowserContextForWindow( | 81 virtual content::BrowserContext* GetBrowserContextForWindow( |
| 76 aura::Window* window) = 0; | 82 aura::Window* window) = 0; |
| 77 | 83 |
| 78 // Returns the maximum possible number of logged in users. | 84 // Returns the maximum possible number of logged in users. |
| 79 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; | 85 virtual int GetMaximumNumberOfLoggedInUsers() const = 0; |
| 80 | 86 |
| 81 // Returns the number of signed in users. If 0 is returned, there is either | 87 // Returns the number of signed in users. If 0 is returned, there is either |
| 82 // no session in progress or no active user. | 88 // no session in progress or no active user. |
| 83 virtual int NumberOfLoggedInUsers() const = 0; | 89 virtual int NumberOfLoggedInUsers() const = 0; |
| 84 | 90 |
| 91 // Returns true if there is possible to add more users to multiprofile | |
| 92 // session. Error is stored in |error| if it is not NULL and function | |
| 93 // returned false. | |
| 94 virtual bool CanAddUserToMultiProfile(MultiProfileAddUserError* error) const; | |
| 95 | |
| 85 // Returns |true| if the session has been fully started for the active user. | 96 // Returns |true| if the session has been fully started for the active user. |
| 86 // When a user becomes active, the profile and browser UI are not immediately | 97 // When a user becomes active, the profile and browser UI are not immediately |
| 87 // available. Only once this method starts returning |true| is the browser | 98 // available. Only once this method starts returning |true| is the browser |
| 88 // startup complete and both profile and UI are fully available. | 99 // startup complete and both profile and UI are fully available. |
| 89 virtual bool IsActiveUserSessionStarted() const = 0; | 100 virtual bool IsActiveUserSessionStarted() const = 0; |
| 90 | 101 |
| 91 // Returns true if the screen can be locked. | 102 // Returns true if the screen can be locked. |
| 92 virtual bool CanLockScreen() const = 0; | 103 virtual bool CanLockScreen() const = 0; |
| 93 | 104 |
| 94 // Returns true if the screen is currently locked. | 105 // Returns true if the screen is currently locked. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 // Adds or removes sessions state observer. | 151 // Adds or removes sessions state observer. |
| 141 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; | 152 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; |
| 142 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; | 153 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; |
| 143 | 154 |
| 144 bool IsInSecondaryLoginScreen() const; | 155 bool IsInSecondaryLoginScreen() const; |
| 145 }; | 156 }; |
| 146 | 157 |
| 147 } // namespace ash | 158 } // namespace ash |
| 148 | 159 |
| 149 #endif // ASH_SESSION_SESSION_STATE_DELEGATE_H_ | 160 #endif // ASH_SESSION_SESSION_STATE_DELEGATE_H_ |
| OLD | NEW |