Add an exponential backoff to rechecking the app list doodle.
[chromium-blink-merge.git] / components / user_manager / user_manager.cc
blob3cf3f267993afb3721fe6531127a583634d6c657
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
3 // found in the LICENSE file.
5 #include "components/user_manager/user_manager.h"
7 #include "base/logging.h"
9 namespace user_manager {
11 UserManager* UserManager::instance = NULL;
13 UserManager::Observer::~Observer() {
16 void UserManager::Observer::LocalStateChanged(UserManager* user_manager) {
19 void UserManager::UserSessionStateObserver::ActiveUserChanged(
20 const User* active_user) {
23 void UserManager::UserSessionStateObserver::UserAddedToSession(
24 const User* active_user) {
27 void UserManager::UserSessionStateObserver::ActiveUserHashChanged(
28 const std::string& hash) {
31 void UserManager::UserSessionStateObserver::UserChangedChildStatus(User* user) {
34 UserManager::UserSessionStateObserver::~UserSessionStateObserver() {
37 UserManager::UserAccountData::UserAccountData(
38 const base::string16& display_name,
39 const base::string16& given_name,
40 const std::string& locale)
41 : display_name_(display_name), given_name_(given_name), locale_(locale) {
44 UserManager::UserAccountData::~UserAccountData() {
47 void UserManager::Initialize() {
48 DCHECK(!UserManager::instance);
49 UserManager::SetInstance(this);
52 // static
53 bool UserManager::IsInitialized() {
54 return UserManager::instance;
57 void UserManager::Destroy() {
58 DCHECK(UserManager::instance == this);
59 UserManager::SetInstance(NULL);
62 // static
63 UserManager* user_manager::UserManager::Get() {
64 CHECK(UserManager::instance);
65 return UserManager::instance;
68 UserManager::~UserManager() {
71 // static
72 void UserManager::SetInstance(UserManager* user_manager) {
73 UserManager::instance = user_manager;
76 // static
77 UserManager* user_manager::UserManager::GetForTesting() {
78 return UserManager::instance;
81 // static
82 UserManager* UserManager::SetForTesting(UserManager* user_manager) {
83 UserManager* previous_instance = UserManager::instance;
84 UserManager::instance = user_manager;
85 return previous_instance;
88 } // namespace user_manager