blob: 597407fa581800990a53f22a873c8beab7a07911 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/user_manager/user_manager.h"
#include "base/logging.h"
namespace user_manager {
UserManager* UserManager::instance = NULL;
UserManager::Observer::~Observer() {
}
void UserManager::Observer::LocalStateChanged(UserManager* user_manager) {
}
void UserManager::UserSessionStateObserver::ActiveUserChanged(
const User* active_user) {
}
void UserManager::UserSessionStateObserver::UserAddedToSession(
const User* active_user) {
}
void UserManager::UserSessionStateObserver::ActiveUserHashChanged(
const std::string& hash) {
}
UserManager::UserSessionStateObserver::~UserSessionStateObserver() {
}
UserManager::UserAccountData::UserAccountData(
const base::string16& display_name,
const base::string16& given_name,
const std::string& locale)
: display_name_(display_name), given_name_(given_name), locale_(locale) {
}
UserManager::UserAccountData::~UserAccountData() {
}
void UserManager::Initialize() {
DCHECK(!UserManager::instance);
UserManager::SetInstance(this);
}
// static
bool UserManager::IsInitialized() {
return UserManager::instance;
}
void UserManager::Destroy() {
DCHECK(UserManager::instance == this);
UserManager::SetInstance(NULL);
}
// static
UserManager* user_manager::UserManager::Get() {
CHECK(UserManager::instance);
return UserManager::instance;
}
UserManager::~UserManager() {
}
// static
void UserManager::SetInstance(UserManager* user_manager) {
UserManager::instance = user_manager;
}
// static
UserManager* user_manager::UserManager::GetForTesting() {
return UserManager::instance;
}
// static
UserManager* UserManager::SetForTesting(UserManager* user_manager) {
UserManager* previous_instance = UserManager::instance;
UserManager::instance = user_manager;
return previous_instance;
}
} // namespace user_manager
|