OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/extensions/extension_service.h" | 6 #include "chrome/browser/extensions/extension_service.h" |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/search_engines/template_url_service.h" | 8 #include "chrome/browser/search_engines/template_url_service.h" |
9 #include "chrome/browser/search_engines/template_url_service_factory.h" | 9 #include "chrome/browser/search_engines/template_url_service_factory.h" |
10 #include "chrome/browser/sync/api/syncable_service.h" | 10 #include "chrome/browser/sync/api/syncable_service.h" |
11 #include "chrome/browser/sync/glue/app_data_type_controller.h" | 11 #include "chrome/browser/sync/glue/app_data_type_controller.h" |
12 #include "chrome/browser/sync/glue/autofill_change_processor.h" | 12 #include "chrome/browser/sync/glue/autofill_change_processor.h" |
13 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" | 13 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
14 #include "chrome/browser/sync/glue/autofill_model_associator.h" | 14 #include "chrome/browser/sync/glue/autofill_model_associator.h" |
15 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h" | |
16 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" | 15 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" |
17 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h" | 16 #include "chrome/browser/sync/glue/autofill_profile_syncable_service.h" |
18 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 17 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
19 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" | 18 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
20 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 19 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
21 #include "chrome/browser/sync/glue/data_type_manager_impl.h" | 20 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
22 #include "chrome/browser/sync/glue/extension_data_type_controller.h" | 21 #include "chrome/browser/sync/glue/extension_data_type_controller.h" |
23 #include "chrome/browser/sync/glue/generic_change_processor.h" | 22 #include "chrome/browser/sync/glue/generic_change_processor.h" |
24 #include "chrome/browser/sync/glue/password_change_processor.h" | 23 #include "chrome/browser/sync/glue/password_change_processor.h" |
25 #include "chrome/browser/sync/glue/password_data_type_controller.h" | 24 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
26 #include "chrome/browser/sync/glue/password_model_associator.h" | 25 #include "chrome/browser/sync/glue/password_model_associator.h" |
27 #include "chrome/browser/sync/glue/preference_data_type_controller.h" | 26 #include "chrome/browser/sync/glue/preference_data_type_controller.h" |
(...skipping 11 matching lines...) Expand all Loading... |
39 #include "chrome/browser/sync/glue/typed_url_model_associator.h" | 38 #include "chrome/browser/sync/glue/typed_url_model_associator.h" |
40 #include "chrome/browser/sync/profile_sync_service.h" | 39 #include "chrome/browser/sync/profile_sync_service.h" |
41 #include "chrome/browser/sync/profile_sync_factory_impl.h" | 40 #include "chrome/browser/sync/profile_sync_factory_impl.h" |
42 #include "chrome/browser/sync/signin_manager.h" | 41 #include "chrome/browser/sync/signin_manager.h" |
43 #include "chrome/browser/webdata/web_data_service.h" | 42 #include "chrome/browser/webdata/web_data_service.h" |
44 #include "chrome/common/chrome_switches.h" | 43 #include "chrome/common/chrome_switches.h" |
45 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
46 | 45 |
47 using browser_sync::AppDataTypeController; | 46 using browser_sync::AppDataTypeController; |
48 using browser_sync::AutofillChangeProcessor; | 47 using browser_sync::AutofillChangeProcessor; |
49 using browser_sync::AutofillProfileChangeProcessor; | |
50 using browser_sync::AutofillDataTypeController; | 48 using browser_sync::AutofillDataTypeController; |
51 using browser_sync::AutofillProfileDataTypeController; | 49 using browser_sync::AutofillProfileDataTypeController; |
52 using browser_sync::AutofillModelAssociator; | 50 using browser_sync::AutofillModelAssociator; |
53 using browser_sync::AutofillProfileModelAssociator; | 51 using browser_sync::AutofillProfileSyncableService; |
54 using browser_sync::BookmarkChangeProcessor; | 52 using browser_sync::BookmarkChangeProcessor; |
55 using browser_sync::BookmarkDataTypeController; | 53 using browser_sync::BookmarkDataTypeController; |
56 using browser_sync::BookmarkModelAssociator; | 54 using browser_sync::BookmarkModelAssociator; |
57 using browser_sync::DataTypeController; | 55 using browser_sync::DataTypeController; |
58 using browser_sync::DataTypeManager; | 56 using browser_sync::DataTypeManager; |
59 using browser_sync::DataTypeManagerImpl; | 57 using browser_sync::DataTypeManagerImpl; |
60 using browser_sync::ExtensionDataTypeController; | 58 using browser_sync::ExtensionDataTypeController; |
61 using browser_sync::GenericChangeProcessor; | 59 using browser_sync::GenericChangeProcessor; |
62 using browser_sync::PasswordChangeProcessor; | 60 using browser_sync::PasswordChangeProcessor; |
63 using browser_sync::PasswordDataTypeController; | 61 using browser_sync::PasswordDataTypeController; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 error_handler); | 206 error_handler); |
209 return SyncComponents(model_associator, change_processor); | 207 return SyncComponents(model_associator, change_processor); |
210 } | 208 } |
211 | 209 |
212 ProfileSyncFactory::SyncComponents | 210 ProfileSyncFactory::SyncComponents |
213 ProfileSyncFactoryImpl::CreateAutofillProfileSyncComponents( | 211 ProfileSyncFactoryImpl::CreateAutofillProfileSyncComponents( |
214 ProfileSyncService* profile_sync_service, | 212 ProfileSyncService* profile_sync_service, |
215 WebDatabase* web_database, | 213 WebDatabase* web_database, |
216 PersonalDataManager* personal_data, | 214 PersonalDataManager* personal_data, |
217 browser_sync::UnrecoverableErrorHandler* error_handler) { | 215 browser_sync::UnrecoverableErrorHandler* error_handler) { |
218 | 216 AutofillProfileSyncableService* sync_service = |
219 AutofillProfileModelAssociator* model_associator = | 217 new AutofillProfileSyncableService(web_database, personal_data, |
220 new AutofillProfileModelAssociator(profile_sync_service, | 218 profile_sync_service->profile()); |
221 web_database, | 219 sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); |
222 personal_data); | 220 GenericChangeProcessor* change_processor = |
223 AutofillProfileChangeProcessor* change_processor = | 221 new GenericChangeProcessor(sync_service, error_handler, user_share); |
224 new AutofillProfileChangeProcessor(model_associator, | 222 browser_sync::SyncableServiceAdapter* sync_service_adapter = |
225 web_database, | 223 new browser_sync::SyncableServiceAdapter(syncable::AUTOFILL_PROFILE, |
226 personal_data, | 224 sync_service, |
227 error_handler); | 225 change_processor); |
228 return SyncComponents(model_associator, change_processor); | 226 return SyncComponents(sync_service_adapter, change_processor); |
229 } | 227 } |
230 | 228 |
231 ProfileSyncFactory::SyncComponents | 229 ProfileSyncFactory::SyncComponents |
232 ProfileSyncFactoryImpl::CreateBookmarkSyncComponents( | 230 ProfileSyncFactoryImpl::CreateBookmarkSyncComponents( |
233 ProfileSyncService* profile_sync_service, | 231 ProfileSyncService* profile_sync_service, |
234 UnrecoverableErrorHandler* error_handler) { | 232 UnrecoverableErrorHandler* error_handler) { |
235 BookmarkModel* bookmark_model = | 233 BookmarkModel* bookmark_model = |
236 profile_sync_service->profile()->GetBookmarkModel(); | 234 profile_sync_service->profile()->GetBookmarkModel(); |
237 sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); | 235 sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); |
238 BookmarkModelAssociator* model_associator = | 236 BookmarkModelAssociator* model_associator = |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 DCHECK(se_sync_service); | 337 DCHECK(se_sync_service); |
340 sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); | 338 sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); |
341 GenericChangeProcessor* change_processor = | 339 GenericChangeProcessor* change_processor = |
342 new GenericChangeProcessor(se_sync_service, error_handler, user_share); | 340 new GenericChangeProcessor(se_sync_service, error_handler, user_share); |
343 SyncableServiceAdapter* sync_service_adapter = | 341 SyncableServiceAdapter* sync_service_adapter = |
344 new SyncableServiceAdapter(syncable::SEARCH_ENGINES, | 342 new SyncableServiceAdapter(syncable::SEARCH_ENGINES, |
345 se_sync_service, | 343 se_sync_service, |
346 change_processor); | 344 change_processor); |
347 return SyncComponents(sync_service_adapter, change_processor); | 345 return SyncComponents(sync_service_adapter, change_processor); |
348 } | 346 } |
OLD | NEW |