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

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

Issue 23005016: [sync] Force re-auth during sync setup if Oauth2 token is unavailable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More feedback Created 7 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/signin/profile_oauth2_token_service.cc ('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_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 6981ccf1118b0c6fb463c93b0118000bed01c60c..ec1e51ad363680f5a8b7e9cc427289979a825371 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper.cc
@@ -1263,11 +1263,14 @@ void OneClickSigninHelper::DidStopLoading(
// default settings.
// - If sign in was initiated from the settings page for first time sync
// set up, show the advanced sync settings dialog.
- // - If sign in was initiated from the settings page due to a re-auth,
- // simply navigate back to the settings page.
+ // - If sign in was initiated from the settings page due to a re-auth when
+ // sync was already setup, simply navigate back to the settings page.
+ ProfileSyncService* sync_service =
+ ProfileSyncServiceFactory::GetForProfile(profile);
OneClickSigninSyncStarter::StartSyncMode start_mode =
source_ == signin::SOURCE_SETTINGS ?
- SigninGlobalError::GetForProfile(profile)->HasMenuItem() ?
+ (SigninGlobalError::GetForProfile(profile)->HasMenuItem() &&
+ sync_service && sync_service->HasSyncSetupCompleted()) ?
OneClickSigninSyncStarter::SHOW_SETTINGS_WITHOUT_CONFIGURE :
OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST :
OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS;
« no previous file with comments | « chrome/browser/signin/profile_oauth2_token_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698