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/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 registry->RegisterDictionaryPref(kSupervisedUserPasswordRevision); | 127 registry->RegisterDictionaryPref(kSupervisedUserPasswordRevision); |
128 | 128 |
129 registry->RegisterDictionaryPref(kSupervisedUserNeedPasswordUpdate); | 129 registry->RegisterDictionaryPref(kSupervisedUserNeedPasswordUpdate); |
130 registry->RegisterDictionaryPref(kSupervisedUserIncompleteKey); | 130 registry->RegisterDictionaryPref(kSupervisedUserIncompleteKey); |
131 } | 131 } |
132 | 132 |
133 SupervisedUserManagerImpl::SupervisedUserManagerImpl( | 133 SupervisedUserManagerImpl::SupervisedUserManagerImpl( |
134 ChromeUserManagerImpl* owner) | 134 ChromeUserManagerImpl* owner) |
135 : owner_(owner), cros_settings_(CrosSettings::Get()) { | 135 : owner_(owner), cros_settings_(CrosSettings::Get()) { |
136 // SupervisedUserManager instance should be used only on UI thread. | 136 // SupervisedUserManager instance should be used only on UI thread. |
137 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 137 // (or in unit_tests) |
| 138 if (base::ThreadTaskRunnerHandle::IsSet()) |
| 139 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
138 authentication_.reset(new SupervisedUserAuthentication(this)); | 140 authentication_.reset(new SupervisedUserAuthentication(this)); |
139 } | 141 } |
140 | 142 |
141 SupervisedUserManagerImpl::~SupervisedUserManagerImpl() { | 143 SupervisedUserManagerImpl::~SupervisedUserManagerImpl() { |
142 } | 144 } |
143 | 145 |
144 std::string SupervisedUserManagerImpl::GenerateUserId() { | 146 std::string SupervisedUserManagerImpl::GenerateUserId() { |
145 int counter = g_browser_process->local_state()-> | 147 int counter = g_browser_process->local_state()-> |
146 GetInteger(kSupervisedUsersNextId); | 148 GetInteger(kSupervisedUsersNextId); |
147 std::string id; | 149 std::string id; |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } | 526 } |
525 | 527 |
526 void SupervisedUserManagerImpl::ConfigureSyncWithToken( | 528 void SupervisedUserManagerImpl::ConfigureSyncWithToken( |
527 Profile* profile, | 529 Profile* profile, |
528 const std::string& token) { | 530 const std::string& token) { |
529 if (!token.empty()) | 531 if (!token.empty()) |
530 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); | 532 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); |
531 } | 533 } |
532 | 534 |
533 } // namespace chromeos | 535 } // namespace chromeos |
OLD | NEW |