Chromium Code Reviews| Index: chrome/browser/managed_mode/managed_user_registration_service.cc |
| =================================================================== |
| --- chrome/browser/managed_mode/managed_user_registration_service.cc (revision 203598) |
| +++ chrome/browser/managed_mode/managed_user_registration_service.cc (working copy) |
| @@ -107,9 +107,10 @@ |
| } |
| ProfileManager::CreateCallback |
| -ManagedUserRegistrationService::GetRegistrationAndInitCallback() { |
| +ManagedUserRegistrationService::GetRegistrationAndInitCallback( |
| + const ProfileManager::CreateCallback& callback) { |
|
Bernhard Bauer
2013/06/03 10:52:47
I wonder if we still need this now that our client
Pam (message me for reviews)
2013/06/03 13:39:28
Cleaned up following our live discussion. Thanks,
|
| return base::Bind(&ManagedUserRegistrationService::OnProfileCreated, |
| - weak_ptr_factory_.GetWeakPtr()); |
| + weak_ptr_factory_.GetWeakPtr(), callback); |
| } |
| void ManagedUserRegistrationService::Shutdown() { |
| @@ -310,16 +311,18 @@ |
| } |
| void ManagedUserRegistrationService::OnProfileCreated( |
| + const ProfileManager::CreateCallback& callback, |
| Profile* profile, |
| Profile::CreateStatus status) { |
| // We're being called back twice: once after the profile has been created on |
| // disk, and once after all the profile services (including the |
| - // ManagedUserService) have been initialized. Ignore the first one. |
| + // ManagedUserService) have been initialized. Ignore the first one, as well as |
| + // any failure statuses. |
| if (status != Profile::CREATE_STATUS_INITIALIZED) |
| return; |
| ManagedUserService* managed_user_service = |
| ManagedUserServiceFactory::GetForProfile(profile); |
| DCHECK(managed_user_service->ProfileIsManaged()); |
| - managed_user_service->RegisterAndInitSync(this); |
| + managed_user_service->RegisterAndInitSync(this, callback); |
| } |