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

Unified Diff: components/browser_sync/browser/profile_sync_service.cc

Issue 2159453002: [Sync] Don't start up sync when FirstSetupCompleted is false and no setup in progress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android fix attempt Created 4 years, 5 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 | components/browser_sync/browser/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browser_sync/browser/profile_sync_service.cc
diff --git a/components/browser_sync/browser/profile_sync_service.cc b/components/browser_sync/browser/profile_sync_service.cc
index 7a57b2f5654bbf4a3e7eee4e2bc37a17e7e9eb21..e5192f9d97a7ce6b1e927adcb62d5e06cfaaab1a 100644
--- a/components/browser_sync/browser/profile_sync_service.cc
+++ b/components/browser_sync/browser/profile_sync_service.cc
@@ -381,7 +381,15 @@ void ProfileSyncService::Initialize() {
base::Bind(&ProfileSyncService::OnMemoryPressure,
sync_enabled_weak_factory_.GetWeakPtr())));
startup_controller_->Reset(GetRegisteredDataTypes());
- startup_controller_->TryStart();
+
+ // Auto-start means means the first time the profile starts up, sync should
+ // start up immediately.
+ if (start_behavior_ == AUTO_START && IsSyncRequested() &&
+ !IsFirstSetupComplete()) {
+ startup_controller_->TryStartImmediately();
+ } else {
+ startup_controller_->TryStart();
+ }
}
void ProfileSyncService::StartSyncingWithServer() {
@@ -2335,7 +2343,7 @@ void ProfileSyncService::RequestStart() {
sync_prefs_.SetSyncRequested(true);
NotifyObservers();
}
- startup_controller_->TryStart();
+ startup_controller_->TryStartImmediately();
}
void ProfileSyncService::ReconfigureDatatypeManager() {
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698