Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5508)

Unified Diff: chrome/browser/managed_mode/managed_user_registration_service.cc

Issue 15774008: Pass errors generated during limited-user registration up to the UI for display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: One more switch statement Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698