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

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

Issue 2066493003: Revert of Sync: Support multiple setup UIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: 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 5f0c8da7319e3d3b01d721f4aeec014651e682a5..95a951dfedc552f8a56d2297eb16ad4dba80a54d 100644
--- a/components/browser_sync/browser/profile_sync_service.cc
+++ b/components/browser_sync/browser/profile_sync_service.cc
@@ -1528,19 +1528,15 @@
return !IsFirstSetupComplete() && startup_controller_->IsSetupInProgress();
}
-std::unique_ptr<sync_driver::SyncSetupInProgressHandle>
-ProfileSyncService::GetSetupInProgressHandle() {
- if (++outstanding_setup_in_progress_handles_ == 1) {
- DCHECK(!startup_controller_->IsSetupInProgress());
- startup_controller_->SetSetupInProgress(true);
-
- NotifyObservers();
- }
-
- return std::unique_ptr<sync_driver::SyncSetupInProgressHandle>(
- new sync_driver::SyncSetupInProgressHandle(
- base::Bind(&ProfileSyncService::OnSetupInProgressHandleDestroyed,
- weak_factory_.GetWeakPtr())));
+void ProfileSyncService::SetSetupInProgress(bool setup_in_progress) {
+ // This method is a no-op if |setup_in_progress_| remains unchanged.
+ if (startup_controller_->IsSetupInProgress() == setup_in_progress)
+ return;
+
+ startup_controller_->SetSetupInProgress(setup_in_progress);
+ if (!setup_in_progress && IsBackendInitialized())
+ ReconfigureDatatypeManager();
+ NotifyObservers();
}
bool ProfileSyncService::IsSyncAllowed() const {
@@ -2548,18 +2544,3 @@
const {
return unrecoverable_error_location_;
}
-
-void ProfileSyncService::OnSetupInProgressHandleDestroyed() {
- DCHECK_GT(outstanding_setup_in_progress_handles_, 0);
-
- // Don't re-start Sync until all outstanding handles are destroyed.
- if (--outstanding_setup_in_progress_handles_ != 0)
- return;
-
- DCHECK(startup_controller_->IsSetupInProgress());
- startup_controller_->SetSetupInProgress(false);
-
- if (IsBackendInitialized())
- ReconfigureDatatypeManager();
- NotifyObservers();
-}
« no previous file with comments | « components/browser_sync/browser/profile_sync_service.h ('k') | components/browser_sync/browser/profile_sync_service_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698