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 | |
295 protected: | 292 protected: |
296 // Sets UserManager instance. | 293 // Sets UserManager instance. |
297 static void SetInstance(UserManager* user_manager); | 294 static void SetInstance(UserManager* user_manager); |
298 | 295 |
299 // Pointer to the existing UserManager instance (if any). | 296 // Pointer to the existing UserManager instance (if any). |
300 // Usually is set by calling Initialize(), reset by calling Destroy(). | 297 // Usually is set by calling Initialize(), reset by calling Destroy(). |
301 // Not owned since specific implementation of UserManager should decide on its | 298 // Not owned since specific implementation of UserManager should decide on its |
302 // own appropriate owner. For src/chrome implementation such place is | 299 // own appropriate owner. For src/chrome implementation such place is |
303 // g_browser_process->platform_part(). | 300 // g_browser_process->platform_part(). |
304 static UserManager* instance; | 301 static UserManager* instance; |
305 | 302 |
306 private: | 303 private: |
307 friend class chromeos::ScopedUserManagerEnabler; | 304 friend class chromeos::ScopedUserManagerEnabler; |
308 | 305 |
309 // Same as Get() but doesn't won't crash is current instance is NULL. | 306 // Same as Get() but doesn't won't crash is current instance is NULL. |
310 static UserManager* GetForTesting(); | 307 static UserManager* GetForTesting(); |
311 | 308 |
312 // Sets UserManager instance to the given |user_manager|. | 309 // Sets UserManager instance to the given |user_manager|. |
313 // Returns the previous value of the instance. | 310 // Returns the previous value of the instance. |
314 static UserManager* SetForTesting(UserManager* user_manager); | 311 static UserManager* SetForTesting(UserManager* user_manager); |
315 }; | 312 }; |
316 | 313 |
317 } // namespace user_manager | 314 } // namespace user_manager |
318 | 315 |
319 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ | 316 #endif // COMPONENTS_USER_MANAGER_USER_MANAGER_H_ |
OLD | NEW |