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 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "base/prefs/scoped_user_pref_update.h" | 11 #include "base/prefs/scoped_user_pref_update.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/threading/sequenced_worker_pool.h" | 15 #include "base/threading/sequenced_worker_pool.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" | 18 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" |
19 #include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h" | 19 #include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h" |
20 #include "chrome/browser/chromeos/login/users/user_manager_impl.h" | 20 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
21 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 21 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
22 #include "chrome/browser/supervised_user/supervised_user_service.h" | 22 #include "chrome/browser/supervised_user/supervised_user_service.h" |
23 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 23 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
24 #include "chromeos/login/user_names.h" | 24 #include "chromeos/login/user_names.h" |
25 #include "chromeos/settings/cros_settings_names.h" | 25 #include "chromeos/settings/cros_settings_names.h" |
26 #include "components/user_manager/user_type.h" | 26 #include "components/user_manager/user_type.h" |
27 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
28 #include "google_apis/gaia/gaia_auth_util.h" | 28 #include "google_apis/gaia/gaia_auth_util.h" |
29 | 29 |
30 using content::BrowserThread; | 30 using content::BrowserThread; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 registry->RegisterDictionaryPref(kSupervisedUserManagerDisplayEmails); | 122 registry->RegisterDictionaryPref(kSupervisedUserManagerDisplayEmails); |
123 | 123 |
124 registry->RegisterDictionaryPref(kSupervisedUserPasswordSchema); | 124 registry->RegisterDictionaryPref(kSupervisedUserPasswordSchema); |
125 registry->RegisterDictionaryPref(kSupervisedUserPasswordSalt); | 125 registry->RegisterDictionaryPref(kSupervisedUserPasswordSalt); |
126 registry->RegisterDictionaryPref(kSupervisedUserPasswordRevision); | 126 registry->RegisterDictionaryPref(kSupervisedUserPasswordRevision); |
127 | 127 |
128 registry->RegisterDictionaryPref(kSupervisedUserNeedPasswordUpdate); | 128 registry->RegisterDictionaryPref(kSupervisedUserNeedPasswordUpdate); |
129 registry->RegisterDictionaryPref(kSupervisedUserIncompleteKey); | 129 registry->RegisterDictionaryPref(kSupervisedUserIncompleteKey); |
130 } | 130 } |
131 | 131 |
132 SupervisedUserManagerImpl::SupervisedUserManagerImpl(UserManagerImpl* owner) | 132 SupervisedUserManagerImpl::SupervisedUserManagerImpl(ChromeUserManager* owner) |
133 : owner_(owner), | 133 : owner_(owner), cros_settings_(CrosSettings::Get()) { |
134 cros_settings_(CrosSettings::Get()) { | |
135 // SupervisedUserManager instance should be used only on UI thread. | 134 // SupervisedUserManager instance should be used only on UI thread. |
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 135 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
137 authentication_.reset(new SupervisedUserAuthentication(this)); | 136 authentication_.reset(new SupervisedUserAuthentication(this)); |
138 } | 137 } |
139 | 138 |
140 SupervisedUserManagerImpl::~SupervisedUserManagerImpl() { | 139 SupervisedUserManagerImpl::~SupervisedUserManagerImpl() { |
141 } | 140 } |
142 | 141 |
143 std::string SupervisedUserManagerImpl::GenerateUserId() { | 142 std::string SupervisedUserManagerImpl::GenerateUserId() { |
144 int counter = g_browser_process->local_state()-> | 143 int counter = g_browser_process->local_state()-> |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 } | 518 } |
520 | 519 |
521 void SupervisedUserManagerImpl::ConfigureSyncWithToken( | 520 void SupervisedUserManagerImpl::ConfigureSyncWithToken( |
522 Profile* profile, | 521 Profile* profile, |
523 const std::string& token) { | 522 const std::string& token) { |
524 if (!token.empty()) | 523 if (!token.empty()) |
525 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); | 524 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); |
526 } | 525 } |
527 | 526 |
528 } // namespace chromeos | 527 } // namespace chromeos |
OLD | NEW |