| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
| 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 6 #define COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 bool browser_restart) = 0; | 162 bool browser_restart) = 0; |
| 163 | 163 |
| 164 // Switches to active user identified by |account_id|. User has to be logged | 164 // Switches to active user identified by |account_id|. User has to be logged |
| 165 // in. | 165 // in. |
| 166 virtual void SwitchActiveUser(const AccountId& account_id) = 0; | 166 virtual void SwitchActiveUser(const AccountId& account_id) = 0; |
| 167 | 167 |
| 168 // Switches to the last active user (called after crash happens and session | 168 // Switches to the last active user (called after crash happens and session |
| 169 // restore has completed). | 169 // restore has completed). |
| 170 virtual void SwitchToLastActiveUser() = 0; | 170 virtual void SwitchToLastActiveUser() = 0; |
| 171 | 171 |
| 172 // Called when browser session is started i.e. after | 172 // Invoked by session manager to inform session start. |
| 173 // browser_creator.LaunchBrowser(...) was called after user sign in. | 173 virtual void OnSessionStarted() = 0; |
| 174 // When user is at the image screen IsUserLoggedIn() will return true | |
| 175 // but IsSessionStarted() will return false. During the kiosk splash screen, | |
| 176 // we perform additional initialization after the user is logged in but | |
| 177 // before the session has been started. | |
| 178 // Fires NOTIFICATION_SESSION_STARTED. | |
| 179 virtual void SessionStarted() = 0; | |
| 180 | 174 |
| 181 // Removes the user from the device. Note, it will verify that the given user | 175 // Removes the user from the device. Note, it will verify that the given user |
| 182 // isn't the owner, so calling this method for the owner will take no effect. | 176 // isn't the owner, so calling this method for the owner will take no effect. |
| 183 // Note, |delegate| can be NULL. | 177 // Note, |delegate| can be NULL. |
| 184 virtual void RemoveUser(const AccountId& account_id, | 178 virtual void RemoveUser(const AccountId& account_id, |
| 185 RemoveUserDelegate* delegate) = 0; | 179 RemoveUserDelegate* delegate) = 0; |
| 186 | 180 |
| 187 // Removes the user from the persistent list only. Also removes the user's | 181 // Removes the user from the persistent list only. Also removes the user's |
| 188 // picture. | 182 // picture. |
| 189 virtual void RemoveUserFromList(const AccountId& account_id) = 0; | 183 virtual void RemoveUserFromList(const AccountId& account_id) = 0; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 288 |
| 295 // Returns true if we're logged in as a legacy supervised user. | 289 // Returns true if we're logged in as a legacy supervised user. |
| 296 virtual bool IsLoggedInAsSupervisedUser() const = 0; | 290 virtual bool IsLoggedInAsSupervisedUser() const = 0; |
| 297 | 291 |
| 298 // Returns true if we're logged in as a kiosk app. | 292 // Returns true if we're logged in as a kiosk app. |
| 299 virtual bool IsLoggedInAsKioskApp() const = 0; | 293 virtual bool IsLoggedInAsKioskApp() const = 0; |
| 300 | 294 |
| 301 // Returns true if we're logged in as the stub user used for testing on Linux. | 295 // Returns true if we're logged in as the stub user used for testing on Linux. |
| 302 virtual bool IsLoggedInAsStub() const = 0; | 296 virtual bool IsLoggedInAsStub() const = 0; |
| 303 | 297 |
| 304 // Returns true if we're logged in and browser has been started i.e. | |
| 305 // browser_creator.LaunchBrowser(...) was called after sign in | |
| 306 // or restart after crash. | |
| 307 virtual bool IsSessionStarted() const = 0; | |
| 308 | |
| 309 // Returns true if data stored or cached for the user with the given | 298 // Returns true if data stored or cached for the user with the given |
| 310 // |account_id| | 299 // |account_id| |
| 311 // address outside that user's cryptohome (wallpaper, avatar, OAuth token | 300 // address outside that user's cryptohome (wallpaper, avatar, OAuth token |
| 312 // status, display name, display email) is to be treated as ephemeral. | 301 // status, display name, display email) is to be treated as ephemeral. |
| 313 virtual bool IsUserNonCryptohomeDataEphemeral( | 302 virtual bool IsUserNonCryptohomeDataEphemeral( |
| 314 const AccountId& account_id) const = 0; | 303 const AccountId& account_id) const = 0; |
| 315 | 304 |
| 316 virtual bool IsUserCryptohomeDataEphemeral( | 305 virtual bool IsUserCryptohomeDataEphemeral( |
| 317 const AccountId& account_id) const = 0; | 306 const AccountId& account_id) const = 0; |
| 318 | 307 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 static UserManager* GetForTesting(); | 386 static UserManager* GetForTesting(); |
| 398 | 387 |
| 399 // Sets UserManager instance to the given |user_manager|. | 388 // Sets UserManager instance to the given |user_manager|. |
| 400 // Returns the previous value of the instance. | 389 // Returns the previous value of the instance. |
| 401 static UserManager* SetForTesting(UserManager* user_manager); | 390 static UserManager* SetForTesting(UserManager* user_manager); |
| 402 }; | 391 }; |
| 403 | 392 |
| 404 } // namespace user_manager | 393 } // namespace user_manager |
| 405 | 394 |
| 406 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 395 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
| OLD | NEW |