| 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/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" | 16 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" |
| 16 #include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h" | 17 #include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h" |
| 17 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" | 18 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" |
| 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 19 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 ListPrefUpdate prefs_new_users_update(local_state, | 201 ListPrefUpdate prefs_new_users_update(local_state, |
| 201 kSupervisedUsersFirstRun); | 202 kSupervisedUsersFirstRun); |
| 202 DictionaryPrefUpdate sync_id_update(local_state, kSupervisedUserSyncId); | 203 DictionaryPrefUpdate sync_id_update(local_state, kSupervisedUserSyncId); |
| 203 DictionaryPrefUpdate manager_update(local_state, kSupervisedUserManagers); | 204 DictionaryPrefUpdate manager_update(local_state, kSupervisedUserManagers); |
| 204 DictionaryPrefUpdate manager_name_update(local_state, | 205 DictionaryPrefUpdate manager_name_update(local_state, |
| 205 kSupervisedUserManagerNames); | 206 kSupervisedUserManagerNames); |
| 206 DictionaryPrefUpdate manager_email_update( | 207 DictionaryPrefUpdate manager_email_update( |
| 207 local_state, | 208 local_state, |
| 208 kSupervisedUserManagerDisplayEmails); | 209 kSupervisedUserManagerDisplayEmails); |
| 209 | 210 |
| 210 prefs_new_users_update->Insert(0, new base::StringValue(local_user_id)); | 211 prefs_new_users_update->Insert( |
| 212 0, base::MakeUnique<base::StringValue>(local_user_id)); |
| 211 | 213 |
| 212 sync_id_update->SetWithoutPathExpansion(local_user_id, | 214 sync_id_update->SetWithoutPathExpansion(local_user_id, |
| 213 new base::StringValue(sync_user_id)); | 215 new base::StringValue(sync_user_id)); |
| 214 manager_update->SetWithoutPathExpansion(local_user_id, | 216 manager_update->SetWithoutPathExpansion(local_user_id, |
| 215 new base::StringValue(manager->email())); | 217 new base::StringValue(manager->email())); |
| 216 manager_name_update->SetWithoutPathExpansion(local_user_id, | 218 manager_name_update->SetWithoutPathExpansion(local_user_id, |
| 217 new base::StringValue(manager->GetDisplayName())); | 219 new base::StringValue(manager->GetDisplayName())); |
| 218 manager_email_update->SetWithoutPathExpansion(local_user_id, | 220 manager_email_update->SetWithoutPathExpansion(local_user_id, |
| 219 new base::StringValue(manager->display_email())); | 221 new base::StringValue(manager->display_email())); |
| 220 | 222 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 } | 525 } |
| 524 | 526 |
| 525 void SupervisedUserManagerImpl::ConfigureSyncWithToken( | 527 void SupervisedUserManagerImpl::ConfigureSyncWithToken( |
| 526 Profile* profile, | 528 Profile* profile, |
| 527 const std::string& token) { | 529 const std::string& token) { |
| 528 if (!token.empty()) | 530 if (!token.empty()) |
| 529 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); | 531 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); |
| 530 } | 532 } |
| 531 | 533 |
| 532 } // namespace chromeos | 534 } // namespace chromeos |
| OLD | NEW |