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

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

Issue 11418200: Setup from settings should allow configuration first (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor cleanup Created 8 years, 1 month 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_helper.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper.cc b/chrome/browser/ui/sync/one_click_signin_helper.cc
index ac9597eddb354b76837c66f00a1a2221ba6660c6..8002692bc8ee8d8cc2fa677a953207dde90656dd 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -726,7 +726,9 @@ void OneClickSigninHelper::DidStopLoading(
break;
case AUTO_ACCEPT_EXPLICIT:
StartSync(browser, auto_accept_, session_index_, email_, password_,
- OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS);
+ source_ == SyncPromoUI::SOURCE_SETTINGS ?
+ OneClickSigninSyncStarter::SIGNIN_ONLY :
+ OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS);
break;
case REJECTED_FOR_PROFILE:
UMA_HISTOGRAM_ENUMERATION("AutoLogin.Reverse",
@@ -738,30 +740,20 @@ void OneClickSigninHelper::DidStopLoading(
break;
}
- AutoAccept local_auto_accept = auto_accept_;
- SyncPromoUI::Source local_source = source_;
+ // If this explicit sign in is not from settings page, show the NTP after
+ // sign in completes. In the case of the settings page, it will get closed
+ // by SyncSetupHandler.
+ if (auto_accept_ == AUTO_ACCEPT_EXPLICIT &&
+ source_ != SyncPromoUI::SOURCE_SETTINGS) {
+ Profile* profile =
+ Profile::FromBrowserContext(contents->GetBrowserContext());
+ signin_tracker_.reset(new SigninTracker(profile, this));
+ }
email_.clear();
password_.clear();
auto_accept_ = NO_AUTO_ACCEPT;
source_ = SyncPromoUI::SOURCE_UNKNOWN;
-
- // If this is an explicit sign in by the user, then redirect them to the
- // NTP.
- if (local_auto_accept == AUTO_ACCEPT_EXPLICIT) {
- // If this is an explicit sign in from settings page, then close the
- // tab. Otherwise show the NTP after sign in completes.
- if (local_source == SyncPromoUI::SOURCE_SETTINGS) {
- contents->Close();
- } else {
- Profile* profile =
- Profile::FromBrowserContext(contents->GetBrowserContext());
- signin_tracker_.reset(new SigninTracker(profile, this));
- }
- }
-
- // |this| may have been deleted due to the contents->Close() call above.
- // No members should be accessed at this point.
}
void OneClickSigninHelper::GaiaCredentialsValid() {
« no previous file with comments | « no previous file | chrome/browser/ui/sync/one_click_signin_sync_starter.h » ('j') | chrome/browser/ui/webui/sync_setup_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698