| 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 COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 namespace syncer { | 26 namespace syncer { |
| 27 | 27 |
| 28 class AssociatorInterface; | 28 class AssociatorInterface; |
| 29 class ChangeProcessor; | 29 class ChangeProcessor; |
| 30 class DataTypeDebugInfoListener; | 30 class DataTypeDebugInfoListener; |
| 31 class DataTypeEncryptionHandler; | 31 class DataTypeEncryptionHandler; |
| 32 class DataTypeManager; | 32 class DataTypeManager; |
| 33 class DataTypeManagerObserver; | 33 class DataTypeManagerObserver; |
| 34 class LocalDeviceInfoProvider; | 34 class LocalDeviceInfoProvider; |
| 35 class SyncBackendHost; | 35 class SyncEngine; |
| 36 class SyncClient; | 36 class SyncClient; |
| 37 class SyncPrefs; | 37 class SyncPrefs; |
| 38 class SyncService; | 38 class SyncService; |
| 39 class SyncableService; | 39 class SyncableService; |
| 40 struct UserShare; | 40 struct UserShare; |
| 41 | 41 |
| 42 // This factory provides sync driver code with the model type specific sync/api | 42 // This factory provides sync driver code with the model type specific sync/api |
| 43 // service (like SyncableService) implementations. | 43 // service (like SyncableService) implementations. |
| 44 class SyncApiComponentFactory { | 44 class SyncApiComponentFactory { |
| 45 public: | 45 public: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 71 ChangeProcessor* change_processor; | 71 ChangeProcessor* change_processor; |
| 72 SyncComponents(AssociatorInterface* ma, ChangeProcessor* cp) | 72 SyncComponents(AssociatorInterface* ma, ChangeProcessor* cp) |
| 73 : model_associator(ma), change_processor(cp) {} | 73 : model_associator(ma), change_processor(cp) {} |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 // Creates and registers enabled datatypes with the provided SyncClient. | 76 // Creates and registers enabled datatypes with the provided SyncClient. |
| 77 virtual void RegisterDataTypes( | 77 virtual void RegisterDataTypes( |
| 78 SyncService* sync_service, | 78 SyncService* sync_service, |
| 79 const RegisterDataTypesMethod& register_platform_types_method) = 0; | 79 const RegisterDataTypesMethod& register_platform_types_method) = 0; |
| 80 | 80 |
| 81 // Instantiates a new DataTypeManager with a SyncBackendHost, a list of data | 81 // Creates a DataTypeManager; the return pointer is owned by the caller. |
| 82 // type controllers and a DataTypeManagerObserver. The return pointer is | |
| 83 // owned by the caller. | |
| 84 virtual DataTypeManager* CreateDataTypeManager( | 82 virtual DataTypeManager* CreateDataTypeManager( |
| 85 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener, | 83 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener, |
| 86 const DataTypeController::TypeMap* controllers, | 84 const DataTypeController::TypeMap* controllers, |
| 87 const DataTypeEncryptionHandler* encryption_handler, | 85 const DataTypeEncryptionHandler* encryption_handler, |
| 88 SyncBackendHost* backend, | 86 SyncEngine* engine, |
| 89 DataTypeManagerObserver* observer) = 0; | 87 DataTypeManagerObserver* observer) = 0; |
| 90 | 88 |
| 91 // Creating this in the factory helps us mock it out in testing. | 89 // Creating this in the factory helps us mock it out in testing. |
| 92 virtual SyncBackendHost* CreateSyncBackendHost( | 90 virtual SyncEngine* CreateSyncEngine( |
| 93 const std::string& name, | 91 const std::string& name, |
| 94 invalidation::InvalidationService* invalidator, | 92 invalidation::InvalidationService* invalidator, |
| 95 const base::WeakPtr<SyncPrefs>& sync_prefs, | 93 const base::WeakPtr<SyncPrefs>& sync_prefs, |
| 96 const base::FilePath& sync_folder) = 0; | 94 const base::FilePath& sync_folder) = 0; |
| 97 | 95 |
| 98 // Creating this in the factory helps us mock it out in testing. | 96 // Creating this in the factory helps us mock it out in testing. |
| 99 virtual std::unique_ptr<LocalDeviceInfoProvider> | 97 virtual std::unique_ptr<LocalDeviceInfoProvider> |
| 100 CreateLocalDeviceInfoProvider() = 0; | 98 CreateLocalDeviceInfoProvider() = 0; |
| 101 | 99 |
| 102 // Legacy datatypes that need to be converted to the SyncableService API. | 100 // Legacy datatypes that need to be converted to the SyncableService API. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 119 std::unique_ptr<AttachmentStoreForSync> attachment_store, | 117 std::unique_ptr<AttachmentStoreForSync> attachment_store, |
| 120 const UserShare& user_share, | 118 const UserShare& user_share, |
| 121 const std::string& store_birthday, | 119 const std::string& store_birthday, |
| 122 ModelType model_type, | 120 ModelType model_type, |
| 123 AttachmentService::Delegate* delegate) = 0; | 121 AttachmentService::Delegate* delegate) = 0; |
| 124 }; | 122 }; |
| 125 | 123 |
| 126 } // namespace syncer | 124 } // namespace syncer |
| 127 | 125 |
| 128 #endif // COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ | 126 #endif // COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ |
| OLD | NEW |