| 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 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "components/sync/api/data_type_error_handler.h" |
| 12 #include "components/sync/api/syncable_service.h" | 13 #include "components/sync/api/syncable_service.h" |
| 13 #include "components/sync/base/model_type.h" | 14 #include "components/sync/base/model_type.h" |
| 14 #include "components/sync/core/attachments/attachment_service.h" | 15 #include "components/sync/core/attachments/attachment_service.h" |
| 15 #include "components/sync/driver/data_type_controller.h" | 16 #include "components/sync/driver/data_type_controller.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class FilePath; | 19 class FilePath; |
| 19 } // namespace base | 20 } // namespace base |
| 20 | 21 |
| 21 namespace browser_sync { | 22 namespace browser_sync { |
| 22 class SyncBackendHost; | 23 class SyncBackendHost; |
| 23 } // namespace browser_sync | 24 } // namespace browser_sync |
| 24 | 25 |
| 25 namespace history { | 26 namespace history { |
| 26 class HistoryBackend; | 27 class HistoryBackend; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace invalidation { | 30 namespace invalidation { |
| 30 class InvalidationService; | 31 class InvalidationService; |
| 31 } // namespace invalidation | 32 } // namespace invalidation |
| 32 | 33 |
| 33 namespace syncer { | 34 namespace syncer { |
| 34 class DataTypeDebugInfoListener; | 35 class DataTypeDebugInfoListener; |
| 35 class DataTypeErrorHandler; | |
| 36 class SyncableService; | 36 class SyncableService; |
| 37 | 37 |
| 38 struct UserShare; | 38 struct UserShare; |
| 39 } // namespace syncer | 39 } // namespace syncer |
| 40 | 40 |
| 41 namespace sync_driver { | 41 namespace sync_driver { |
| 42 | 42 |
| 43 class AssociatorInterface; | 43 class AssociatorInterface; |
| 44 class ChangeProcessor; | 44 class ChangeProcessor; |
| 45 class DataTypeEncryptionHandler; | 45 class DataTypeEncryptionHandler; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, | 110 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, |
| 111 const base::FilePath& sync_folder) = 0; | 111 const base::FilePath& sync_folder) = 0; |
| 112 | 112 |
| 113 // Creating this in the factory helps us mock it out in testing. | 113 // Creating this in the factory helps us mock it out in testing. |
| 114 virtual std::unique_ptr<sync_driver::LocalDeviceInfoProvider> | 114 virtual std::unique_ptr<sync_driver::LocalDeviceInfoProvider> |
| 115 CreateLocalDeviceInfoProvider() = 0; | 115 CreateLocalDeviceInfoProvider() = 0; |
| 116 | 116 |
| 117 // Legacy datatypes that need to be converted to the SyncableService API. | 117 // Legacy datatypes that need to be converted to the SyncableService API. |
| 118 virtual SyncComponents CreateBookmarkSyncComponents( | 118 virtual SyncComponents CreateBookmarkSyncComponents( |
| 119 sync_driver::SyncService* sync_service, | 119 sync_driver::SyncService* sync_service, |
| 120 syncer::DataTypeErrorHandler* error_handler) = 0; | 120 std::unique_ptr<syncer::DataTypeErrorHandler> error_handler) = 0; |
| 121 | 121 |
| 122 // Creates attachment service. | 122 // Creates attachment service. |
| 123 // Note: Should only be called from the model type thread. | 123 // Note: Should only be called from the model type thread. |
| 124 // | 124 // |
| 125 // |store_birthday| is the store birthday. Must not be empty. | 125 // |store_birthday| is the store birthday. Must not be empty. |
| 126 // | 126 // |
| 127 // |model_type| is the model type this AttachmentService will be used with. | 127 // |model_type| is the model type this AttachmentService will be used with. |
| 128 // | 128 // |
| 129 // |delegate| is optional delegate for AttachmentService to notify about | 129 // |delegate| is optional delegate for AttachmentService to notify about |
| 130 // asynchronous events (AttachmentUploaded). Pass NULL if delegate is not | 130 // asynchronous events (AttachmentUploaded). Pass NULL if delegate is not |
| 131 // provided. AttachmentService doesn't take ownership of delegate, the pointer | 131 // provided. AttachmentService doesn't take ownership of delegate, the pointer |
| 132 // must be valid throughout AttachmentService lifetime. | 132 // must be valid throughout AttachmentService lifetime. |
| 133 virtual std::unique_ptr<syncer::AttachmentService> CreateAttachmentService( | 133 virtual std::unique_ptr<syncer::AttachmentService> CreateAttachmentService( |
| 134 std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store, | 134 std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store, |
| 135 const syncer::UserShare& user_share, | 135 const syncer::UserShare& user_share, |
| 136 const std::string& store_birthday, | 136 const std::string& store_birthday, |
| 137 syncer::ModelType model_type, | 137 syncer::ModelType model_type, |
| 138 syncer::AttachmentService::Delegate* delegate) = 0; | 138 syncer::AttachmentService::Delegate* delegate) = 0; |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace sync_driver | 141 } // namespace sync_driver |
| 142 | 142 |
| 143 #endif // COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ | 143 #endif // COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ |
| OLD | NEW |