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

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

Issue 10885011: Its possible for sync to be suppressed before the user attempts one-click (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 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 | « no previous file | 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 62e8019a6a9767e19c8cfe8aa81c78124ece84c5..79ccfd3a8e186259eddb817b419edd661242aad4 100644
--- a/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
+++ b/chrome/browser/ui/sync/one_click_signin_sync_starter.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "chrome/browser/sync/sync_prefs.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/webui/signin/login_ui_service.h"
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
@@ -24,11 +25,17 @@ OneClickSigninSyncStarter::OneClickSigninSyncStarter(
start_mode_(start_mode) {
DCHECK(browser_);
- ProfileSyncService* profile_sync_service =
- ProfileSyncServiceFactory::GetForProfile(browser_->profile());
// Let the sync service know that setup is in progress so it doesn't start
// syncing until the user has finished any configuration.
+ ProfileSyncService* profile_sync_service =
+ ProfileSyncServiceFactory::GetForProfile(browser_->profile());
profile_sync_service->SetSetupInProgress(true);
+
+ // Make sure the syncing is not suppressed, otherwise the SigninManager
+ // will not be able to compelte sucessfully.
+ browser_sync::SyncPrefs sync_prefs(browser_->profile()->GetPrefs());
+ sync_prefs.SetStartSuppressed(false);
+
SigninManager* manager = SigninManagerFactory::GetForProfile(
browser_->profile());
manager->StartSignInWithCredentials(session_index, email, password);
@@ -56,7 +63,6 @@ void OneClickSigninSyncStarter::SigninSuccess() {
// Just kick off the sync machine, no need to configure it first.
profile_sync_service->SetSyncSetupCompleted();
profile_sync_service->SetSetupInProgress(false);
- profile_sync_service->UnsuppressAndStart();
} else {
// Give the user a chance to configure things. We don't clear the
// ProfileSyncService::setup_in_progress flag because we don't want sync
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698