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

Unified Diff: chrome/browser/ui/sync/one_click_signin_sync_starter.cc

Issue 447883002: Make sure sync setup completes when signing in from the avatar bubble with modal warnings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/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();
}

Powered by Google App Engine
This is Rietveld 408576698