| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/chromeos/login/user.h" | 10 #include "chrome/browser/chromeos/login/user.h" |
| 11 #include "chrome/browser/chromeos/login/user_flow.h" | 11 #include "chrome/browser/chromeos/login/user_flow.h" |
| 12 | 12 |
| 13 class PrefRegistrySimple; | 13 class PrefRegistrySimple; |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 | 16 |
| 17 class RemoveUserDelegate; | 17 class RemoveUserDelegate; |
| 18 class UserImageManager; | 18 class UserImageManager; |
| 19 | 19 |
| 20 // Base class for UserManagerImpl - provides a mechanism for discovering users | 20 // Base class for UserManagerImpl - provides a mechanism for discovering users |
| 21 // who have logged into this Chrome OS device before and updating that list. | 21 // who have logged into this Chrome OS device before and updating that list. |
| 22 class UserManager { | 22 class UserManager { |
| 23 public: | 23 public: |
| 24 // Status of merge sessions process which is responsible for exchanging | 24 // Status of merge sessions process which is responsible for exchanging |
| 25 // user OAuth2 refresh token for GAIA cookies. | 25 // user OAuth2 refresh token for GAIA cookies. |
| 26 enum MergeSessionState { | 26 enum MergeSessionState { |
| 27 // Session merge hasn't started yet. | 27 // Session merge can't start yet until we get the refresh token. |
| 28 MERGE_STATUS_NOT_STARTED, | 28 MERGE_STATUS_UNINITILIZED, |
| 29 // Session merge is in process. | 29 // Session merge fetching hasn't started yet. |
| 30 MERGE_STATUS_PREPARING, |
| 31 // Session merge related requests to GAIA are in progress. |
| 30 MERGE_STATUS_IN_PROCESS, | 32 MERGE_STATUS_IN_PROCESS, |
| 31 // Session merge is completed. | 33 // Session merge is completed. |
| 32 MERGE_STATUS_DONE, | 34 MERGE_STATUS_DONE, |
| 33 }; | 35 }; |
| 34 | 36 |
| 35 // Interface that observers of UserManager must implement in order | 37 // Interface that observers of UserManager must implement in order |
| 36 // to receive notification when local state preferences is changed | 38 // to receive notification when local state preferences is changed |
| 37 class Observer { | 39 class Observer { |
| 38 public: | 40 public: |
| 39 // Called when the local state preferences is changed. | 41 // Called when the local state preferences is changed. |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 virtual bool IsLoggedInAsKioskApp() const = 0; | 296 virtual bool IsLoggedInAsKioskApp() const = 0; |
| 295 | 297 |
| 296 // Returns true if we're logged in as the stub user used for testing on Linux. | 298 // Returns true if we're logged in as the stub user used for testing on Linux. |
| 297 virtual bool IsLoggedInAsStub() const = 0; | 299 virtual bool IsLoggedInAsStub() const = 0; |
| 298 | 300 |
| 299 // Returns true if we're logged in and browser has been started i.e. | 301 // Returns true if we're logged in and browser has been started i.e. |
| 300 // browser_creator.LaunchBrowser(...) was called after sign in | 302 // browser_creator.LaunchBrowser(...) was called after sign in |
| 301 // or restart after crash. | 303 // or restart after crash. |
| 302 virtual bool IsSessionStarted() const = 0; | 304 virtual bool IsSessionStarted() const = 0; |
| 303 | 305 |
| 306 // Returns session duration in seconds. If the session hasn't started yet, |
| 307 // the function returns -1. |
| 308 virtual int64 GetSessionDurationInSeconds() const = 0; |
| 309 |
| 304 // Returns true iff browser has been restarted after crash and UserManager | 310 // Returns true iff browser has been restarted after crash and UserManager |
| 305 // finished restoring user sessions. | 311 // finished restoring user sessions. |
| 306 virtual bool UserSessionsRestored() const = 0; | 312 virtual bool UserSessionsRestored() const = 0; |
| 307 | 313 |
| 308 // Returns merge session status. | 314 // Returns merge session status. |
| 309 virtual MergeSessionState GetMergeSessionState() const = 0; | 315 virtual MergeSessionState GetMergeSessionState() const = 0; |
| 310 | 316 |
| 311 // Changes merge session status. | 317 // Changes merge session status. |
| 312 virtual void SetMergeSessionState(MergeSessionState status) = 0; | 318 virtual void SetMergeSessionState(MergeSessionState status) = 0; |
| 313 | 319 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 ScopedTestUserManager(); | 408 ScopedTestUserManager(); |
| 403 ~ScopedTestUserManager(); | 409 ~ScopedTestUserManager(); |
| 404 | 410 |
| 405 private: | 411 private: |
| 406 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager); | 412 DISALLOW_COPY_AND_ASSIGN(ScopedTestUserManager); |
| 407 }; | 413 }; |
| 408 | 414 |
| 409 } // namespace chromeos | 415 } // namespace chromeos |
| 410 | 416 |
| 411 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ | 417 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_MANAGER_H_ |
| OLD | NEW |