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

Side by Side Diff: components/browser_sync/browser/profile_sync_service.h

Issue 2044303004: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ 5 #ifndef COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_
6 #define COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ 6 #define COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // The "sync everything" state cannot be read from ProfileSyncService, but 158 // The "sync everything" state cannot be read from ProfileSyncService, but
159 // is instead pulled from SyncPrefs.HasKeepEverythingSynced(). 159 // is instead pulled from SyncPrefs.HasKeepEverythingSynced().
160 // 160 //
161 // Initial sync setup: 161 // Initial sync setup:
162 // 162 //
163 // For privacy reasons, it is usually desirable to avoid syncing any data 163 // For privacy reasons, it is usually desirable to avoid syncing any data
164 // types until the user has finished setting up sync. There are two APIs 164 // types until the user has finished setting up sync. There are two APIs
165 // that control the initial sync download: 165 // that control the initial sync download:
166 // 166 //
167 // * SetFirstSetupComplete() 167 // * SetFirstSetupComplete()
168 // * SetSetupInProgress() 168 // * GetSetupInProgressHandle()
169 // 169 //
170 // SetFirstSetupComplete() should be called once the user has finished setting 170 // SetFirstSetupComplete() should be called once the user has finished setting
171 // up sync at least once on their account. SetSetupInProgress(true) should be 171 // up sync at least once on their account. GetSetupInProgressHandle() should
172 // called while the user is actively configuring their account, and then 172 // be called while the user is actively configuring their account. The handle
173 // SetSetupInProgress(false) should be called when configuration is complete. 173 // should be deleted once configuration is complete.
174 // Once both these conditions have been met, CanConfigureDataTypes() will 174 //
175 // return true and datatype configuration can begin. 175 // Once first setup has completed and there are no outstanding
176 // setup-in-progress handles, CanConfigureDataTypes() will return true and
177 // datatype configuration can begin.
176 class ProfileSyncService : public sync_driver::SyncService, 178 class ProfileSyncService : public sync_driver::SyncService,
177 public sync_driver::SyncFrontend, 179 public sync_driver::SyncFrontend,
178 public sync_driver::SyncPrefObserver, 180 public sync_driver::SyncPrefObserver,
179 public sync_driver::DataTypeManagerObserver, 181 public sync_driver::DataTypeManagerObserver,
180 public syncer::UnrecoverableErrorHandler, 182 public syncer::UnrecoverableErrorHandler,
181 public KeyedService, 183 public KeyedService,
182 public OAuth2TokenService::Consumer, 184 public OAuth2TokenService::Consumer,
183 public OAuth2TokenService::Observer, 185 public OAuth2TokenService::Observer,
184 public SigninManagerBase::Observer, 186 public SigninManagerBase::Observer,
185 public GaiaCookieManagerService::Observer { 187 public GaiaCookieManagerService::Observer {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 bool CanSyncStart() const override; 275 bool CanSyncStart() const override;
274 void RequestStop(SyncStopDataFate data_fate) override; 276 void RequestStop(SyncStopDataFate data_fate) override;
275 void RequestStart() override; 277 void RequestStart() override;
276 syncer::ModelTypeSet GetActiveDataTypes() const override; 278 syncer::ModelTypeSet GetActiveDataTypes() const override;
277 sync_driver::SyncClient* GetSyncClient() const override; 279 sync_driver::SyncClient* GetSyncClient() const override;
278 syncer::ModelTypeSet GetPreferredDataTypes() const override; 280 syncer::ModelTypeSet GetPreferredDataTypes() const override;
279 void OnUserChoseDatatypes(bool sync_everything, 281 void OnUserChoseDatatypes(bool sync_everything,
280 syncer::ModelTypeSet chosen_types) override; 282 syncer::ModelTypeSet chosen_types) override;
281 void SetFirstSetupComplete() override; 283 void SetFirstSetupComplete() override;
282 bool IsFirstSetupInProgress() const override; 284 bool IsFirstSetupInProgress() const override;
283 void SetSetupInProgress(bool setup_in_progress) override;
284 bool IsSetupInProgress() const override; 285 bool IsSetupInProgress() const override;
285 bool ConfigurationDone() const override; 286 bool ConfigurationDone() const override;
286 const GoogleServiceAuthError& GetAuthError() const override; 287 const GoogleServiceAuthError& GetAuthError() const override;
287 bool HasUnrecoverableError() const override; 288 bool HasUnrecoverableError() const override;
288 bool IsBackendInitialized() const override; 289 bool IsBackendInitialized() const override;
289 sync_driver::OpenTabsUIDelegate* GetOpenTabsUIDelegate() override; 290 sync_driver::OpenTabsUIDelegate* GetOpenTabsUIDelegate() override;
290 bool IsPassphraseRequiredForDecryption() const override; 291 bool IsPassphraseRequiredForDecryption() const override;
291 base::Time GetExplicitPassphraseTime() const override; 292 base::Time GetExplicitPassphraseTime() const override;
292 bool IsUsingSecondaryPassphrase() const override; 293 bool IsUsingSecondaryPassphrase() const override;
293 void EnableEncryptEverything() override; 294 void EnableEncryptEverything() override;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 // Needed to test whether the directory is deleted properly. 588 // Needed to test whether the directory is deleted properly.
588 base::FilePath GetDirectoryPathForTest() const; 589 base::FilePath GetDirectoryPathForTest() const;
589 590
590 // Sometimes we need to wait for tasks on the sync thread in tests. 591 // Sometimes we need to wait for tasks on the sync thread in tests.
591 base::MessageLoop* GetSyncLoopForTest() const; 592 base::MessageLoop* GetSyncLoopForTest() const;
592 593
593 // Triggers sync cycle with request to update specified |types|. 594 // Triggers sync cycle with request to update specified |types|.
594 void RefreshTypesForTest(syncer::ModelTypeSet types); 595 void RefreshTypesForTest(syncer::ModelTypeSet types);
595 596
596 protected: 597 protected:
598 // sync_driver::SyncService implementation
599 void SetSetupInProgress(bool setup_in_progress) override;
600
597 // Helper to install and configure a data type manager. 601 // Helper to install and configure a data type manager.
598 void ConfigureDataTypeManager(); 602 void ConfigureDataTypeManager();
599 603
600 // Shuts down the backend sync components. 604 // Shuts down the backend sync components.
601 // |reason| dictates if syncing is being disabled or not, and whether 605 // |reason| dictates if syncing is being disabled or not, and whether
602 // to claim ownership of sync thread from backend. 606 // to claim ownership of sync thread from backend.
603 void ShutdownImpl(syncer::ShutdownReason reason); 607 void ShutdownImpl(syncer::ShutdownReason reason);
604 608
605 // Return SyncCredentials from the OAuth2TokenService. 609 // Return SyncCredentials from the OAuth2TokenService.
606 syncer::SyncCredentials GetCredentials(); 610 syncer::SyncCredentials GetCredentials();
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_; 1024 base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_;
1021 1025
1022 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); 1026 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
1023 }; 1027 };
1024 1028
1025 bool ShouldShowActionOnUI( 1029 bool ShouldShowActionOnUI(
1026 const syncer::SyncProtocolError& error); 1030 const syncer::SyncProtocolError& error);
1027 1031
1028 1032
1029 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ 1033 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698