Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 // * GetActiveDataTypes() | 147 // * GetActiveDataTypes() |
| 148 // * IsUsingSecondaryPassphrase() | 148 // * IsUsingSecondaryPassphrase() |
| 149 // * IsEncryptEverythingEnabled() | 149 // * IsEncryptEverythingEnabled() |
| 150 // * IsPassphraseRequired()/IsPassphraseRequiredForDecryption() | 150 // * IsPassphraseRequired()/IsPassphraseRequiredForDecryption() |
| 151 // | 151 // |
| 152 // The "sync everything" state cannot be read from ProfileSyncService, but | 152 // The "sync everything" state cannot be read from ProfileSyncService, but |
| 153 // is instead pulled from SyncPrefs.HasKeepEverythingSynced(). | 153 // is instead pulled from SyncPrefs.HasKeepEverythingSynced(). |
| 154 // | 154 // |
| 155 // Initial sync setup: | 155 // Initial sync setup: |
| 156 // | 156 // |
| 157 // For privacy reasons, it is usually desirable to avoid syncing any data | 157 // For privacy reasons, it is usually desirable to avoid syncing any data |
|
Nicolas Zea
2016/02/29 21:21:55
Maybe update this comment to mention IsSetupComple
maxbogue
2016/03/09 02:00:59
Done, PTAL.
| |
| 158 // types until the user has finished setting up sync. There are two APIs | 158 // types until the user has finished setting up sync. There are two APIs |
| 159 // that control the initial sync download: | 159 // that control the initial sync download: |
| 160 // | 160 // |
| 161 // * SetFirstSetupComplete() | 161 // * SetFirstSetupComplete() |
| 162 // * SetSetupInProgress() | 162 // * SetSetupInProgress() |
| 163 // | 163 // |
| 164 // SetFirstSetupComplete() should be called once the user has finished setting | 164 // SetFirstSetupComplete() should be called once the user has finished setting |
| 165 // up sync at least once on their account. SetSetupInProgress(true) should be | 165 // up sync at least once on their account. SetSetupInProgress(true) should be |
| 166 // called while the user is actively configuring their account, and then | 166 // called while the user is actively configuring their account, and then |
| 167 // SetSetupInProgress(false) should be called when configuration is complete. | 167 // SetSetupInProgress(false) should be called when configuration is complete. |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 501 virtual bool IsEncryptEverythingAllowed() const; | 501 virtual bool IsEncryptEverythingAllowed() const; |
| 502 | 502 |
| 503 // Sets whether encrypting all the sync data is allowed or not. | 503 // Sets whether encrypting all the sync data is allowed or not. |
| 504 virtual void SetEncryptEverythingAllowed(bool allowed); | 504 virtual void SetEncryptEverythingAllowed(bool allowed); |
| 505 | 505 |
| 506 // Returns true if the syncer is waiting for new datatypes to be encrypted. | 506 // Returns true if the syncer is waiting for new datatypes to be encrypted. |
| 507 virtual bool encryption_pending() const; | 507 virtual bool encryption_pending() const; |
| 508 | 508 |
| 509 SigninManagerBase* signin() const; | 509 SigninManagerBase* signin() const; |
| 510 | 510 |
| 511 // Used by tests. | |
| 512 bool auto_start_enabled() const; | |
| 513 | |
| 514 SyncErrorController* sync_error_controller() { | 511 SyncErrorController* sync_error_controller() { |
| 515 return sync_error_controller_.get(); | 512 return sync_error_controller_.get(); |
| 516 } | 513 } |
| 517 | 514 |
| 518 // TODO(sync): This is only used in tests. Can we remove it? | 515 // TODO(sync): This is only used in tests. Can we remove it? |
| 519 const sync_driver::DataTypeStatusTable& data_type_status_table() const; | 516 const sync_driver::DataTypeStatusTable& data_type_status_table() const; |
| 520 | 517 |
| 521 sync_driver::DataTypeManager::ConfigureStatus configure_status() { | 518 sync_driver::DataTypeManager::ConfigureStatus configure_status() { |
| 522 return configure_status_; | 519 return configure_status_; |
| 523 } | 520 } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 775 | 772 |
| 776 // Calls data type manager to start catch up configure. | 773 // Calls data type manager to start catch up configure. |
| 777 void BeginConfigureCatchUpBeforeClear(); | 774 void BeginConfigureCatchUpBeforeClear(); |
| 778 | 775 |
| 779 // Calls sync backend to send ClearServerDataMessage to server. | 776 // Calls sync backend to send ClearServerDataMessage to server. |
| 780 void ClearAndRestartSyncForPassphraseEncryption(); | 777 void ClearAndRestartSyncForPassphraseEncryption(); |
| 781 | 778 |
| 782 // Restarts sync clearing directory in the process. | 779 // Restarts sync clearing directory in the process. |
| 783 void OnClearServerDataDone(); | 780 void OnClearServerDataDone(); |
| 784 | 781 |
| 782 // True if setup has been completed at least once and is not in progress. | |
| 783 bool IsSetupComplete() const; | |
|
Nicolas Zea
2016/02/29 21:21:55
I wonder if there's a better way of distinguishing
maxbogue
2016/03/09 02:00:59
Changed to CanConfigureDatatypes; that sound good?
| |
| 784 | |
| 785 // This profile's SyncClient, which abstracts away non-Sync dependencies and | 785 // This profile's SyncClient, which abstracts away non-Sync dependencies and |
| 786 // the Sync API component factory. | 786 // the Sync API component factory. |
| 787 scoped_ptr<sync_driver::SyncClient> sync_client_; | 787 scoped_ptr<sync_driver::SyncClient> sync_client_; |
| 788 | 788 |
| 789 // The class that handles getting, setting, and persisting sync | 789 // The class that handles getting, setting, and persisting sync |
| 790 // preferences. | 790 // preferences. |
| 791 sync_driver::SyncPrefs sync_prefs_; | 791 sync_driver::SyncPrefs sync_prefs_; |
| 792 | 792 |
| 793 // TODO(ncarter): Put this in a profile, once there is UI for it. | 793 // TODO(ncarter): Put this in a profile, once there is UI for it. |
| 794 // This specifies where to find the sync server. | 794 // This specifies where to find the sync server. |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 994 base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_; | 994 base::WeakPtrFactory<ProfileSyncService> startup_controller_weak_factory_; |
| 995 | 995 |
| 996 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 996 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 997 }; | 997 }; |
| 998 | 998 |
| 999 bool ShouldShowActionOnUI( | 999 bool ShouldShowActionOnUI( |
| 1000 const syncer::SyncProtocolError& error); | 1000 const syncer::SyncProtocolError& error); |
| 1001 | 1001 |
| 1002 | 1002 |
| 1003 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ | 1003 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |