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

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: rebased 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
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a459fc5b5c58bf71397a85aa66e2bc27ba7b7862..eef6c522a281e3b5107e02ed04e0e4443fca97df 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -185,14 +185,41 @@ void OneClickSigninSyncStarter::SigninDialogDelegate::OnCancelSignin() {
void OneClickSigninSyncStarter::SigninDialogDelegate::OnContinueSignin() {
SetUserChoiceHistogram(SIGNIN_CHOICE_CONTINUE);
- if (sync_starter_ != NULL)
+
+ if (sync_starter_ != NULL) {
+ // 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 (sync_starter_->GetStartSyncMode() == CONFIRM_SYNC_SETTINGS_FIRST)
+ sync_starter_->SetStartSyncMode(SYNC_WITH_DEFAULT_SETTINGS);
sync_starter_->LoadPolicyWithCachedCredentials();
+ }
}
void OneClickSigninSyncStarter::SigninDialogDelegate::OnSigninWithNewProfile() {
SetUserChoiceHistogram(SIGNIN_CHOICE_NEW_PROFILE);
- if (sync_starter_ != NULL)
+
+ if (sync_starter_ != NULL) {
+ // TODO(guohui): add a sync settings link to allow user to configure sync
+ // settings before sync starts.
+ if (sync_starter_->GetStartSyncMode() == CONFIRM_SYNC_SETTINGS_FIRST)
+ sync_starter_->SetStartSyncMode(SYNC_WITH_DEFAULT_SETTINGS);
sync_starter_->CreateNewSignedInProfile();
+ }
+}
+
+void OneClickSigninSyncStarter::SetStartSyncMode(StartSyncMode start_mode) {
+ start_mode_ = start_mode;
+}
+
+OneClickSigninSyncStarter::StartSyncMode
+ OneClickSigninSyncStarter::GetStartSyncMode() {
+ return start_mode_;
}
void OneClickSigninSyncStarter::OnRegisteredForPolicy(
@@ -369,8 +396,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();
}
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698