Index: chrome/browser/ui/sync/one_click_signin_sync_starter.cc |
diff --git a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc |
index 8c713f84ed9c102655be49f0ae12b14ba2bd6c0d..e1293dd2eab24e5da58117b44fe99f13bdf39d70 100644 |
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc |
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc |
@@ -185,12 +185,30 @@ void OneClickSigninSyncStarter::SigninDialogDelegate::OnCancelSignin() { |
void OneClickSigninSyncStarter::SigninDialogDelegate::OnContinueSignin() { |
SetUserChoiceHistogram(SIGNIN_CHOICE_CONTINUE); |
+ |
+ // If the user signs in from the new avatar bubble, the enterprise |
+ // confirmation dialog would dismiss the avatar bubble, thus it won't show any |
+ // confirmation upon sign in completes. This cofirmation dialog already |
+ // mentions that user data would be synced, thus we just start sync |
+ // immediately. |
+ |
+ // TODO(guohui): add a sync settings link to allow user to configure sync |
+ // settings before sync starts. |
+ if (start_mode == CONFIRM_SYNC_SETTINGS_FIRST) |
+ start_mode = SYNC_WITH_DEFAULT_SETTINGS; |
+ |
if (sync_starter_ != NULL) |
sync_starter_->LoadPolicyWithCachedCredentials(); |
} |
void OneClickSigninSyncStarter::SigninDialogDelegate::OnSigninWithNewProfile() { |
SetUserChoiceHistogram(SIGNIN_CHOICE_NEW_PROFILE); |
+ |
+ // TODO(guohui): add a sync settings link to allow user to configure sync |
+ // settings before sync starts. |
+ if (start_mode == CONFIRM_SYNC_SETTINGS_FIRST) |
+ start_mode = SYNC_WITH_DEFAULT_SETTINGS; |
+ |
if (sync_starter_ != NULL) |
sync_starter_->CreateNewSignedInProfile(); |
} |
@@ -369,8 +387,17 @@ void OneClickSigninSyncStarter::UntrustedSigninConfirmed( |
} else { |
// If the user clicked the "Advanced" link in the confirmation dialog, then |
// override the current start_mode_ to bring up the advanced sync settings. |
+ |
+ // If the user signs in from the new avatar bubble, the untrusted dialog |
+ // would dismiss the avatar bubble, thus it won't show any confirmation upon |
+ // sign in completes. This dialog already has a settings link, thus we just |
+ // start sync immediately . |
+ |
if (response == CONFIGURE_SYNC_FIRST) |
start_mode_ = response; |
+ else if (start_mode_ == CONFIRM_SYNC_SETTINGS_FIRST) |
+ start_mode_ = SYNC_WITH_DEFAULT_SETTINGS |
+ |
SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
signin->CompletePendingSignin(); |
} |