| 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 CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_H__ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_H__ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_H__ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 virtual browser_sync::GenericChangeProcessor* CreateGenericChangeProcessor( | 73 virtual browser_sync::GenericChangeProcessor* CreateGenericChangeProcessor( |
| 74 ProfileSyncService* profile_sync_service, | 74 ProfileSyncService* profile_sync_service, |
| 75 browser_sync::DataTypeErrorHandler* error_handler, | 75 browser_sync::DataTypeErrorHandler* error_handler, |
| 76 const base::WeakPtr<SyncableService>& local_service) = 0; | 76 const base::WeakPtr<SyncableService>& local_service) = 0; |
| 77 | 77 |
| 78 virtual browser_sync::SharedChangeProcessor* | 78 virtual browser_sync::SharedChangeProcessor* |
| 79 CreateSharedChangeProcessor() = 0; | 79 CreateSharedChangeProcessor() = 0; |
| 80 | 80 |
| 81 // Returns a weak pointer to the syncable service specified by |type|. | 81 // Returns a weak pointer to the syncable service specified by |type|. |
| 82 // Weak pointer may be unset if service is already destroyed. | 82 // Weak pointer may be unset if service is already destroyed. |
| 83 // Note: Should only be called on the same thread on which a datatype resides. |
| 83 virtual base::WeakPtr<SyncableService> GetSyncableServiceForType( | 84 virtual base::WeakPtr<SyncableService> GetSyncableServiceForType( |
| 84 syncable::ModelType type) = 0; | 85 syncable::ModelType type) = 0; |
| 85 | 86 |
| 86 // Returns a weak pointer to the SyncableService associated with the datatype. | 87 // Legacy datatypes that need to be converted to the SyncableService API. |
| 87 // The SyncableService is not owned by Sync, but by the backend service | |
| 88 // itself. | |
| 89 virtual base::WeakPtr<SyncableService> GetAutofillProfileSyncableService( | |
| 90 WebDataService* web_data_service) const = 0; | |
| 91 | |
| 92 // Returns a weak pointer to the SyncableService associated with the datatype. | |
| 93 // The SyncableService is not owned by Sync, but by the backend service | |
| 94 // itself. | |
| 95 virtual base::WeakPtr<SyncableService> GetAutocompleteSyncableService( | |
| 96 WebDataService* web_data_service) const = 0; | |
| 97 | |
| 98 // Instantiates both a model associator and change processor for the | |
| 99 // bookmark data type. The pointers in the return struct are owned | |
| 100 // by the caller. | |
| 101 virtual SyncComponents CreateBookmarkSyncComponents( | 88 virtual SyncComponents CreateBookmarkSyncComponents( |
| 102 ProfileSyncService* profile_sync_service, | 89 ProfileSyncService* profile_sync_service, |
| 103 browser_sync::DataTypeErrorHandler* error_handler) = 0; | 90 browser_sync::DataTypeErrorHandler* error_handler) = 0; |
| 104 | |
| 105 // Instantiates both a model associator and change processor for the | |
| 106 // extension or app setting data type. The pointers in the return struct are | |
| 107 // owned by the caller. | |
| 108 virtual SyncComponents CreateExtensionOrAppSettingSyncComponents( | |
| 109 // Either EXTENSION_SETTINGS or APP_SETTINGS. | |
| 110 syncable::ModelType type, | |
| 111 ProfileSyncService* profile_sync_service, | |
| 112 browser_sync::DataTypeErrorHandler* error_handler) = 0; | |
| 113 | |
| 114 // Instantiates both a model associator and change processor for the | |
| 115 // extension or app data types. The pointers in the return struct are | |
| 116 // owned by the caller. | |
| 117 virtual SyncComponents CreateExtensionOrAppSyncComponents( | |
| 118 syncable::ModelType type, // Either EXTENSIONS or APPS. | |
| 119 ProfileSyncService* profile_sync_service, | |
| 120 browser_sync::DataTypeErrorHandler* error_handler) = 0; | |
| 121 | |
| 122 // Instantiates both a model associator and change processor for the | |
| 123 // password data type. The pointers in the return struct are | |
| 124 // owned by the caller. | |
| 125 virtual SyncComponents CreatePasswordSyncComponents( | 91 virtual SyncComponents CreatePasswordSyncComponents( |
| 126 ProfileSyncService* profile_sync_service, | 92 ProfileSyncService* profile_sync_service, |
| 127 PasswordStore* password_store, | 93 PasswordStore* password_store, |
| 128 browser_sync::DataTypeErrorHandler* error_handler) = 0; | 94 browser_sync::DataTypeErrorHandler* error_handler) = 0; |
| 129 | |
| 130 // Instantiates both a model associator and change processor for the | |
| 131 // preference data type. The pointers in the return struct are | |
| 132 // owned by the caller. | |
| 133 virtual SyncComponents CreatePreferenceSyncComponents( | |
| 134 ProfileSyncService* profile_sync_service, | |
| 135 browser_sync::DataTypeErrorHandler* error_handler) = 0; | |
| 136 | |
| 137 // Instantiates both a model associator and change processor for the | |
| 138 // theme data type. The pointers in the return struct are | |
| 139 // owned by the caller. | |
| 140 virtual SyncComponents CreateThemeSyncComponents( | 95 virtual SyncComponents CreateThemeSyncComponents( |
| 141 ProfileSyncService* profile_sync_service, | 96 ProfileSyncService* profile_sync_service, |
| 142 browser_sync::DataTypeErrorHandler* error_handler) = 0; | 97 browser_sync::DataTypeErrorHandler* error_handler) = 0; |
| 143 | |
| 144 // Instantiates both a model associator and change processor for the | |
| 145 // typed_url data type. The pointers in the return struct are owned | |
| 146 // by the caller. | |
| 147 virtual SyncComponents CreateTypedUrlSyncComponents( | 98 virtual SyncComponents CreateTypedUrlSyncComponents( |
| 148 ProfileSyncService* profile_sync_service, | 99 ProfileSyncService* profile_sync_service, |
| 149 history::HistoryBackend* history_backend, | 100 history::HistoryBackend* history_backend, |
| 150 browser_sync::DataTypeErrorHandler* error_handler) = 0; | 101 browser_sync::DataTypeErrorHandler* error_handler) = 0; |
| 151 | |
| 152 // Instantiates both a model associator and change processor for the | |
| 153 // session data type. The pointers in the return struct are | |
| 154 // owned by the caller. | |
| 155 virtual SyncComponents CreateSessionSyncComponents( | 102 virtual SyncComponents CreateSessionSyncComponents( |
| 156 ProfileSyncService* profile_sync_service, | 103 ProfileSyncService* profile_sync_service, |
| 157 browser_sync::DataTypeErrorHandler* error_handler) = 0; | 104 browser_sync::DataTypeErrorHandler* error_handler) = 0; |
| 158 | |
| 159 // Instantiates both a model associator and change processor for the search | |
| 160 // engine data type. The pointers in the return struct are owned by the | |
| 161 // caller. | |
| 162 virtual SyncComponents CreateSearchEngineSyncComponents( | |
| 163 ProfileSyncService* profile_sync_service, | |
| 164 browser_sync::DataTypeErrorHandler* error_handler) = 0; | |
| 165 | |
| 166 // Instantiates both a model associator and change processor for the app | |
| 167 // notification data type. The pointers in the return struct are owned by the | |
| 168 // caller. | |
| 169 virtual SyncComponents CreateAppNotificationSyncComponents( | |
| 170 ProfileSyncService* profile_sync_service, | |
| 171 browser_sync::DataTypeErrorHandler* error_handler) = 0; | |
| 172 }; | 105 }; |
| 173 | 106 |
| 174 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_H__ | 107 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_H__ |
| OLD | NEW |