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

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

Issue 14655009: Client changes for disabled dasher account (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 7 years, 7 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 dc1b99838f723cee569fc91ca919e0446c5ea41f..fb42f38847b635e8bfc9f0e62da33ab0a8c71725 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -220,9 +220,7 @@ void OneClickSigninSyncStarter::CompleteSigninForNewProfile(
// Copy credentials from the old profile to the just-created profile,
// and switch over to tracking that profile.
new_signin_manager->CopyCredentialsFrom(*old_signin_manager);
- ProfileSyncService* profile_sync_service = GetProfileSyncService();
- if (profile_sync_service)
- profile_sync_service->SetSetupInProgress(false);
+ FinishProfileSyncServiceSetup();
Initialize(new_profile, NULL);
DCHECK_EQ(profile_, new_profile);
@@ -273,9 +271,7 @@ void OneClickSigninSyncStarter::UntrustedSigninConfirmed(
void OneClickSigninSyncStarter::SigninFailed(
const GoogleServiceAuthError& error) {
- ProfileSyncService* profile_sync_service = GetProfileSyncService();
- if (profile_sync_service)
- profile_sync_service->SetSetupInProgress(false);
+ FinishProfileSyncServiceSetup();
if (confirmation_required_ == CONFIRM_AFTER_SIGNIN) {
switch (error.state()) {
case GoogleServiceAuthError::SERVICE_UNAVAILABLE:
@@ -303,8 +299,8 @@ void OneClickSigninSyncStarter::SigninSuccess() {
profile_sync_service->OnUserChoseDatatypes(true,
syncer::ModelTypeSet());
profile_sync_service->SetSyncSetupCompleted();
- profile_sync_service->SetSetupInProgress(false);
}
+ FinishProfileSyncServiceSetup();
if (confirmation_required_ == CONFIRM_AFTER_SIGNIN) {
string16 message;
if (!profile_sync_service) {
@@ -369,6 +365,7 @@ void OneClickSigninSyncStarter::ConfigureSync() {
}
} else {
// Sync is disabled - just display the settings page.
+ FinishProfileSyncServiceSetup();
chrome::ShowSettings(browser_);
}
}
@@ -381,6 +378,13 @@ ProfileSyncService* OneClickSigninSyncStarter::GetProfileSyncService() {
return service;
}
+void OneClickSigninSyncStarter::FinishProfileSyncServiceSetup() {
+ ProfileSyncService* service =
+ ProfileSyncServiceFactory::GetForProfile(profile_);
+ if (service)
+ service->SetSetupInProgress(false);
+}
+
void OneClickSigninSyncStarter::ShowSyncSettingsPageOnSameTab() {
std::string url = std::string(chrome::kChromeUISettingsURL) +
chrome::kSyncSetupSubPage;
« no previous file with comments | « chrome/browser/ui/sync/one_click_signin_sync_starter.h ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698