| Index: chrome/browser/sync/glue/sync_backend_host.h
|
| diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
|
| index f757649381fe86af22a3a10e5b62f9c5e1a2f8aa..7fe6bcb3f793e53acb75c408c579bfa5c229b794 100644
|
| --- a/chrome/browser/sync/glue/sync_backend_host.h
|
| +++ b/chrome/browser/sync/glue/sync_backend_host.h
|
| @@ -87,6 +87,9 @@ class SyncFrontend {
|
| // encrypted using the accepted passphrase.
|
| virtual void OnPassphraseAccepted() = 0;
|
|
|
| + virtual void OnEncryptionComplete(
|
| + const syncable::ModelTypeSet& encrypted_types) = 0;
|
| +
|
| protected:
|
| // Don't delete through SyncFrontend interface.
|
| virtual ~SyncFrontend() {
|
| @@ -157,6 +160,14 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| const syncable::ModelTypeSet& types,
|
| CancelableTask* ready_task);
|
|
|
| + // Encrypts the specified datatypes and marks them as needing encryption on
|
| + // other machines. This affects all machines synced to this account and all
|
| + // data belonging to the specified types. |encrypted_types| must be a subset
|
| + // of the enabled datatypes.
|
| + // Note: actual work is done on core_thread_'s message loop.
|
| + virtual void EncryptDataTypes(
|
| + const syncable::ModelTypeSet& encrypted_types);
|
| +
|
| syncable::AutofillMigrationState
|
| GetAutofillMigrationState();
|
|
|
| @@ -273,6 +284,8 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| virtual void OnUpdatedToken(const std::string& token);
|
| virtual void OnClearServerDataFailed();
|
| virtual void OnClearServerDataSucceeded();
|
| + virtual void OnEncryptionComplete(
|
| + const syncable::ModelTypeSet& encrypted_types);
|
|
|
| // JsBackend implementation.
|
| virtual void SetParentJsEventRouter(JsEventRouter* router);
|
| @@ -336,6 +349,10 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| // on behalf of SyncBackendHost::SupplyPassphrase.
|
| void DoSetPassphrase(const std::string& passphrase, bool is_explicit);
|
|
|
| + // Called on SyncBackendHost's |core_thread_| to set the datatypes we need
|
| + // to encrypt as well as encrypt all local data of that type.
|
| + void DoEncryptDataTypes(const syncable::ModelTypeSet& encrypted_types);
|
| +
|
| // The shutdown order is a bit complicated:
|
| // 1) From |core_thread_|, invoke the syncapi Shutdown call to do a final
|
| // SaveChanges, close sqlite handles, and halt the syncer thread (which
|
| @@ -432,6 +449,11 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| // Invoked when an updated token is available from the sync server.
|
| void NotifyUpdatedToken(const std::string& token);
|
|
|
| + // Invoked when sync finishes encrypting new datatypes or has become aware
|
| + // of new datatypes requiring encryption.
|
| + void NotifyEncryptionComplete(const syncable::ModelTypeSet&
|
| + encrypted_types);
|
| +
|
| // Called from Core::OnSyncCycleCompleted to handle updating frontend
|
| // thread components.
|
| void HandleSyncCycleCompletedOnFrontendLoop(
|
| @@ -498,7 +520,6 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| scoped_refptr<Core> core_;
|
|
|
| private:
|
| -
|
| UIModelWorker* ui_worker();
|
|
|
| void ConfigureAutofillMigration();
|
|
|