| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 ManagedUserService* managed_user_service = | 1169 ManagedUserService* managed_user_service = |
| 1170 ManagedUserServiceFactory::GetForProfile(new_profile); | 1170 ManagedUserServiceFactory::GetForProfile(new_profile); |
| 1171 | 1171 |
| 1172 // Register the managed user using the profile of the custodian. | 1172 // Register the managed user using the profile of the custodian. |
| 1173 managed_user_registration_utility_ = | 1173 managed_user_registration_utility_ = |
| 1174 ManagedUserRegistrationUtility::Create(Profile::FromWebUI(web_ui())); | 1174 ManagedUserRegistrationUtility::Create(Profile::FromWebUI(web_ui())); |
| 1175 managed_user_service->RegisterAndInitSync( | 1175 managed_user_service->RegisterAndInitSync( |
| 1176 managed_user_registration_utility_.get(), | 1176 managed_user_registration_utility_.get(), |
| 1177 Profile::FromWebUI(web_ui()), | 1177 Profile::FromWebUI(web_ui()), |
| 1178 managed_user_id, | 1178 managed_user_id, |
| 1179 false, // TODO(ibraaaa): update this when avatar selection UI is ready. |
| 1179 base::Bind(&BrowserOptionsHandler::OnManagedUserRegistered, | 1180 base::Bind(&BrowserOptionsHandler::OnManagedUserRegistered, |
| 1180 weak_ptr_factory_.GetWeakPtr(), | 1181 weak_ptr_factory_.GetWeakPtr(), |
| 1181 desktop_type, | 1182 desktop_type, |
| 1182 new_profile)); | 1183 new_profile)); |
| 1183 } | 1184 } |
| 1184 | 1185 |
| 1185 void BrowserOptionsHandler::RecordProfileCreationMetrics( | 1186 void BrowserOptionsHandler::RecordProfileCreationMetrics( |
| 1186 Profile::CreateStatus status) { | 1187 Profile::CreateStatus status) { |
| 1187 UMA_HISTOGRAM_ENUMERATION("Profile.CreateResult", | 1188 UMA_HISTOGRAM_ENUMERATION("Profile.CreateResult", |
| 1188 status, | 1189 status, |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1857 const ProfileInfoCache& cache = | 1858 const ProfileInfoCache& cache = |
| 1858 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1859 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 1859 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { | 1860 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { |
| 1860 if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i)) | 1861 if (existing_managed_user_id == cache.GetManagedUserIdOfProfileAtIndex(i)) |
| 1861 return false; | 1862 return false; |
| 1862 } | 1863 } |
| 1863 return true; | 1864 return true; |
| 1864 } | 1865 } |
| 1865 | 1866 |
| 1866 } // namespace options | 1867 } // namespace options |
| OLD | NEW |