| 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_STATE_DELEGATE_H_ | 5 #ifndef ASH_SESSION_STATE_DELEGATE_H_ |
| 6 #define ASH_SESSION_STATE_DELEGATE_H_ | 6 #define ASH_SESSION_STATE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // TODO(oshima): Replace MultiProfileIndex with BrowsreContext, bacause | 38 // TODO(oshima): Replace MultiProfileIndex with BrowsreContext, bacause |
| 39 // GetUserXXX are useful for non multi profile scenario in ash_shell. | 39 // GetUserXXX are useful for non multi profile scenario in ash_shell. |
| 40 class ASH_EXPORT SessionStateDelegate { | 40 class ASH_EXPORT SessionStateDelegate { |
| 41 public: | 41 public: |
| 42 // Defines the cycle direction for |CycleActiveUser|. | 42 // Defines the cycle direction for |CycleActiveUser|. |
| 43 enum CycleUser { | 43 enum CycleUser { |
| 44 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. | 44 CYCLE_TO_NEXT_USER = 0, // Cycle to the next user. |
| 45 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. | 45 CYCLE_TO_PREVIOUS_USER, // Cycle to the previous user. |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // Defines session state i.e. whether session is running or not and |
| 49 // whether user session is blocked by things like multi-profile login. |
| 50 enum SessionState { |
| 51 // When primary user login UI is shown i.e. after boot or sign out, |
| 52 // no active user session exists yet. |
| 53 SESSION_STATE_LOGIN_PRIMARY = 0, |
| 54 |
| 55 // Inside user session (including lock screen), |
| 56 // no login UI (primary or multi-profiles) is shown. |
| 57 SESSION_STATE_ACTIVE, |
| 58 |
| 59 // When secondary user login UI is shown i.e. other users are |
| 60 // already logged in and is currently adding another user to the session. |
| 61 SESSION_STATE_LOGIN_SECONDARY, |
| 62 }; |
| 63 |
| 48 virtual ~SessionStateDelegate() {}; | 64 virtual ~SessionStateDelegate() {}; |
| 49 | 65 |
| 50 // Returns the browser context for the user given by |index|. | 66 // Returns the browser context for the user given by |index|. |
| 51 virtual content::BrowserContext* GetBrowserContextByIndex( | 67 virtual content::BrowserContext* GetBrowserContextByIndex( |
| 52 MultiProfileIndex index) = 0; | 68 MultiProfileIndex index) = 0; |
| 53 | 69 |
| 54 // Returns the browser context associated with the window. | 70 // Returns the browser context associated with the window. |
| 55 virtual content::BrowserContext* GetBrowserContextForWindow( | 71 virtual content::BrowserContext* GetBrowserContextForWindow( |
| 56 aura::Window* window) = 0; | 72 aura::Window* window) = 0; |
| 57 | 73 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 82 virtual void LockScreen() = 0; | 98 virtual void LockScreen() = 0; |
| 83 | 99 |
| 84 // Unlocks the screen. | 100 // Unlocks the screen. |
| 85 virtual void UnlockScreen() = 0; | 101 virtual void UnlockScreen() = 0; |
| 86 | 102 |
| 87 // Returns |true| if user session blocked by some overlying UI. It can be | 103 // Returns |true| if user session blocked by some overlying UI. It can be |
| 88 // login screen, lock screen or screen for adding users into multi-profile | 104 // login screen, lock screen or screen for adding users into multi-profile |
| 89 // session. | 105 // session. |
| 90 virtual bool IsUserSessionBlocked() const = 0; | 106 virtual bool IsUserSessionBlocked() const = 0; |
| 91 | 107 |
| 108 // Returns current session state. |
| 109 virtual SessionState GetSessionState() const = 0; |
| 110 |
| 92 // Gets the displayed name for the user with the given |index|. | 111 // Gets the displayed name for the user with the given |index|. |
| 93 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | 112 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. |
| 94 virtual const base::string16 GetUserDisplayName( | 113 virtual const base::string16 GetUserDisplayName( |
| 95 MultiProfileIndex index) const = 0; | 114 MultiProfileIndex index) const = 0; |
| 96 | 115 |
| 97 // Gets the given name of the user with |index|. An empty string can be | 116 // Gets the given name of the user with |index|. An empty string can be |
| 98 // returned if the given name of the user is unknown. | 117 // returned if the given name of the user is unknown. |
| 99 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. | 118 // Note that |index| can at maximum be |NumberOfLoggedInUsers() - 1|. |
| 100 virtual const base::string16 GetUserGivenName( | 119 virtual const base::string16 GetUserGivenName( |
| 101 MultiProfileIndex index) const = 0; | 120 MultiProfileIndex index) const = 0; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 127 virtual void CycleActiveUser(CycleUser cycle_user) = 0; | 146 virtual void CycleActiveUser(CycleUser cycle_user) = 0; |
| 128 | 147 |
| 129 // Adds or removes sessions state observer. | 148 // Adds or removes sessions state observer. |
| 130 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; | 149 virtual void AddSessionStateObserver(SessionStateObserver* observer) = 0; |
| 131 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; | 150 virtual void RemoveSessionStateObserver(SessionStateObserver* observer) = 0; |
| 132 }; | 151 }; |
| 133 | 152 |
| 134 } // namespace ash | 153 } // namespace ash |
| 135 | 154 |
| 136 #endif // ASH_SESSION_STATE_DELEGATE_H_ | 155 #endif // ASH_SESSION_STATE_DELEGATE_H_ |
| OLD | NEW |