| 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 "components/user_manager/user.h" | 10 #include "components/user_manager/user.h" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 virtual void RemoveObserver(Observer* obs) = 0; | 282 virtual void RemoveObserver(Observer* obs) = 0; |
| 283 | 283 |
| 284 virtual void AddSessionStateObserver(UserSessionStateObserver* obs) = 0; | 284 virtual void AddSessionStateObserver(UserSessionStateObserver* obs) = 0; |
| 285 virtual void RemoveSessionStateObserver(UserSessionStateObserver* obs) = 0; | 285 virtual void RemoveSessionStateObserver(UserSessionStateObserver* obs) = 0; |
| 286 | 286 |
| 287 virtual void NotifyLocalStateChanged() = 0; | 287 virtual void NotifyLocalStateChanged() = 0; |
| 288 | 288 |
| 289 // Returns true if supervised users allowed. | 289 // Returns true if supervised users allowed. |
| 290 virtual bool AreSupervisedUsersAllowed() const = 0; | 290 virtual bool AreSupervisedUsersAllowed() const = 0; |
| 291 | 291 |
| 292 // Force update login state. |
| 293 virtual void ForceUpdateState() {} |
| 294 |
| 292 protected: | 295 protected: |
| 293 // Sets UserManager instance. | 296 // Sets UserManager instance. |
| 294 static void SetInstance(UserManager* user_manager); | 297 static void SetInstance(UserManager* user_manager); |
| 295 | 298 |
| 296 // Pointer to the existing UserManager instance (if any). | 299 // Pointer to the existing UserManager instance (if any). |
| 297 // Usually is set by calling Initialize(), reset by calling Destroy(). | 300 // Usually is set by calling Initialize(), reset by calling Destroy(). |
| 298 // Not owned since specific implementation of UserManager should decide on its | 301 // Not owned since specific implementation of UserManager should decide on its |
| 299 // own appropriate owner. For src/chrome implementation such place is | 302 // own appropriate owner. For src/chrome implementation such place is |
| 300 // g_browser_process->platform_part(). | 303 // g_browser_process->platform_part(). |
| 301 static UserManager* instance; | 304 static UserManager* instance; |
| 302 | 305 |
| 303 private: | 306 private: |
| 304 friend class chromeos::ScopedUserManagerEnabler; | 307 friend class chromeos::ScopedUserManagerEnabler; |
| 305 | 308 |
| 306 // Same as Get() but doesn't won't crash is current instance is NULL. | 309 // Same as Get() but doesn't won't crash is current instance is NULL. |
| 307 static UserManager* GetForTesting(); | 310 static UserManager* GetForTesting(); |
| 308 | 311 |
| 309 // Sets UserManager instance to the given |user_manager|. | 312 // Sets UserManager instance to the given |user_manager|. |
| 310 // Returns the previous value of the instance. | 313 // Returns the previous value of the instance. |
| 311 static UserManager* SetForTesting(UserManager* user_manager); | 314 static UserManager* SetForTesting(UserManager* user_manager); |
| 312 }; | 315 }; |
| 313 | 316 |
| 314 } // namespace user_manager | 317 } // namespace user_manager |
| 315 | 318 |
| 316 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 319 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
| OLD | NEW |