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

Unified Diff: chrome/browser/managed_mode/managed_user_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: Addressed Drew's comments 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
« no previous file with comments | « chrome/browser/managed_mode/managed_user_service.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/managed_mode/managed_user_service.cc
===================================================================
--- chrome/browser/managed_mode/managed_user_service.cc (revision 203598)
+++ chrome/browser/managed_mode/managed_user_service.cc (working copy)
@@ -520,24 +520,29 @@
}
void ManagedUserService::RegisterAndInitSync(
- ManagedUserRegistrationService* registration_service) {
- string16 name = UTF8ToUTF16(profile_->GetProfileName());
+ ManagedUserRegistrationService* registration_service,
+ const ProfileManager::CreateCallback& callback) {
+ string16 name = UTF8ToUTF16(
+ profile_->GetPrefs()->GetString(prefs::kProfileName));
registration_service->Register(
name,
base::Bind(&ManagedUserService::OnManagedUserRegistered,
- weak_ptr_factory_.GetWeakPtr()));
+ weak_ptr_factory_.GetWeakPtr(), callback));
}
void ManagedUserService::OnManagedUserRegistered(
+ const ProfileManager::CreateCallback& callback,
const GoogleServiceAuthError& auth_error,
const std::string& token) {
if (auth_error.state() != GoogleServiceAuthError::NONE) {
LOG(ERROR) << "Managed user OAuth error: " << auth_error.ToString();
DCHECK_EQ(std::string(), token);
+ callback.Run(profile_, Profile::CREATE_STATUS_REMOTE_FAIL);
return;
}
InitSync(token);
+ callback.Run(profile_, Profile::CREATE_STATUS_INITIALIZED);
}
void ManagedUserService::UpdateManualHosts() {
« no previous file with comments | « chrome/browser/managed_mode/managed_user_service.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698