| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "sync/internal_api/sync_rollback_manager_base.h" | 10 #include "sync/internal_api/sync_rollback_manager_base.h" |
| 11 #include "url/gurl.h" |
| 11 | 12 |
| 12 namespace syncer { | 13 namespace syncer { |
| 13 | 14 |
| 14 // SyncBackupManager runs before user signs in to sync to back up user's data | 15 // SyncBackupManager runs before user signs in to sync to back up user's data |
| 15 // before sync starts. The data that's backed up can be used to restore user's | 16 // before sync starts. The data that's backed up can be used to restore user's |
| 16 // settings to pre-sync state. | 17 // settings to pre-sync state. |
| 17 class SYNC_EXPORT_PRIVATE SyncBackupManager : public SyncRollbackManagerBase { | 18 class SYNC_EXPORT_PRIVATE SyncBackupManager : public SyncRollbackManagerBase { |
| 18 public: | 19 public: |
| 19 SyncBackupManager(); | 20 SyncBackupManager(); |
| 20 virtual ~SyncBackupManager(); | 21 virtual ~SyncBackupManager(); |
| 21 | 22 |
| 22 // SyncManager implementation. | 23 // SyncManager implementation. |
| 23 virtual void Init( | 24 virtual void Init( |
| 24 const base::FilePath& database_location, | 25 const base::FilePath& database_location, |
| 25 const WeakHandle<JsEventHandler>& event_handler, | 26 const WeakHandle<JsEventHandler>& event_handler, |
| 26 const std::string& sync_server_and_path, | 27 const GURL& service_url, |
| 27 int sync_server_port, | |
| 28 bool use_ssl, | |
| 29 scoped_ptr<HttpPostProviderFactory> post_factory, | 28 scoped_ptr<HttpPostProviderFactory> post_factory, |
| 30 const std::vector<scoped_refptr<ModelSafeWorker> >& workers, | 29 const std::vector<scoped_refptr<ModelSafeWorker> >& workers, |
| 31 ExtensionsActivity* extensions_activity, | 30 ExtensionsActivity* extensions_activity, |
| 32 SyncManager::ChangeDelegate* change_delegate, | 31 SyncManager::ChangeDelegate* change_delegate, |
| 33 const SyncCredentials& credentials, | 32 const SyncCredentials& credentials, |
| 34 const std::string& invalidator_client_id, | 33 const std::string& invalidator_client_id, |
| 35 const std::string& restored_key_for_bootstrapping, | 34 const std::string& restored_key_for_bootstrapping, |
| 36 const std::string& restored_keystore_key_for_bootstrapping, | 35 const std::string& restored_keystore_key_for_bootstrapping, |
| 37 InternalComponentsFactory* internal_components_factory, | 36 InternalComponentsFactory* internal_components_factory, |
| 38 Encryptor* encryptor, | 37 Encryptor* encryptor, |
| 39 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, | 38 scoped_ptr<UnrecoverableErrorHandler> unrecoverable_error_handler, |
| 40 ReportUnrecoverableErrorFunction | 39 ReportUnrecoverableErrorFunction report_unrecoverable_error_function, |
| 41 report_unrecoverable_error_function, | |
| 42 CancelationSignal* cancelation_signal) OVERRIDE; | 40 CancelationSignal* cancelation_signal) OVERRIDE; |
| 43 virtual void SaveChanges() OVERRIDE; | 41 virtual void SaveChanges() OVERRIDE; |
| 44 virtual SyncStatus GetDetailedStatus() const OVERRIDE; | 42 virtual SyncStatus GetDetailedStatus() const OVERRIDE; |
| 45 | 43 |
| 46 // DirectoryChangeDelegate implementation. | 44 // DirectoryChangeDelegate implementation. |
| 47 virtual ModelTypeSet HandleTransactionEndingChangeEvent( | 45 virtual ModelTypeSet HandleTransactionEndingChangeEvent( |
| 48 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 46 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
| 49 syncable::BaseTransaction* trans) OVERRIDE; | 47 syncable::BaseTransaction* trans) OVERRIDE; |
| 50 | 48 |
| 51 virtual void RegisterDirectoryTypeDebugInfoObserver( | 49 virtual void RegisterDirectoryTypeDebugInfoObserver( |
| (...skipping 22 matching lines...) Expand all Loading... |
| 74 bool in_normalization_; | 72 bool in_normalization_; |
| 75 | 73 |
| 76 SyncStatus status_; | 74 SyncStatus status_; |
| 77 | 75 |
| 78 DISALLOW_COPY_AND_ASSIGN(SyncBackupManager); | 76 DISALLOW_COPY_AND_ASSIGN(SyncBackupManager); |
| 79 }; | 77 }; |
| 80 | 78 |
| 81 } // namespace syncer | 79 } // namespace syncer |
| 82 | 80 |
| 83 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | 81 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ |
| OLD | NEW |