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/sync/api/syncable_service.h" |
8 #include "chrome/browser/sync/glue/app_change_processor.h" | 9 #include "chrome/browser/sync/glue/app_change_processor.h" |
9 #include "chrome/browser/sync/glue/app_data_type_controller.h" | 10 #include "chrome/browser/sync/glue/app_data_type_controller.h" |
10 #include "chrome/browser/sync/glue/app_model_associator.h" | 11 #include "chrome/browser/sync/glue/app_model_associator.h" |
11 #include "chrome/browser/sync/glue/autofill_change_processor.h" | 12 #include "chrome/browser/sync/glue/autofill_change_processor.h" |
12 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" | 13 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" |
13 #include "chrome/browser/sync/glue/autofill_model_associator.h" | 14 #include "chrome/browser/sync/glue/autofill_model_associator.h" |
14 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h" | 15 #include "chrome/browser/sync/glue/autofill_profile_change_processor.h" |
15 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" | 16 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" |
16 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h" | 17 #include "chrome/browser/sync/glue/autofill_profile_model_associator.h" |
17 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 18 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
18 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" | 19 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" |
19 #include "chrome/browser/sync/glue/bookmark_model_associator.h" | 20 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
20 #include "chrome/browser/sync/glue/data_type_manager_impl.h" | 21 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
21 #include "chrome/browser/sync/glue/extension_change_processor.h" | 22 #include "chrome/browser/sync/glue/extension_change_processor.h" |
22 #include "chrome/browser/sync/glue/extension_data_type_controller.h" | 23 #include "chrome/browser/sync/glue/extension_data_type_controller.h" |
23 #include "chrome/browser/sync/glue/extension_model_associator.h" | 24 #include "chrome/browser/sync/glue/extension_model_associator.h" |
24 #include "chrome/browser/sync/glue/extension_sync_traits.h" | 25 #include "chrome/browser/sync/glue/extension_sync_traits.h" |
25 #include "chrome/browser/sync/glue/generic_change_processor.h" | 26 #include "chrome/browser/sync/glue/generic_change_processor.h" |
26 #include "chrome/browser/sync/glue/password_change_processor.h" | 27 #include "chrome/browser/sync/glue/password_change_processor.h" |
27 #include "chrome/browser/sync/glue/password_data_type_controller.h" | 28 #include "chrome/browser/sync/glue/password_data_type_controller.h" |
28 #include "chrome/browser/sync/glue/password_model_associator.h" | 29 #include "chrome/browser/sync/glue/password_model_associator.h" |
29 #include "chrome/browser/sync/glue/preference_data_type_controller.h" | 30 #include "chrome/browser/sync/glue/preference_data_type_controller.h" |
30 #include "chrome/browser/sync/glue/session_change_processor.h" | 31 #include "chrome/browser/sync/glue/session_change_processor.h" |
31 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 32 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
32 #include "chrome/browser/sync/glue/session_model_associator.h" | 33 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 34 #include "chrome/browser/sync/glue/syncable_service_adapter.h" |
33 #include "chrome/browser/sync/glue/sync_backend_host.h" | 35 #include "chrome/browser/sync/glue/sync_backend_host.h" |
34 #include "chrome/browser/sync/glue/theme_change_processor.h" | 36 #include "chrome/browser/sync/glue/theme_change_processor.h" |
35 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 37 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
36 #include "chrome/browser/sync/glue/theme_model_associator.h" | 38 #include "chrome/browser/sync/glue/theme_model_associator.h" |
37 #include "chrome/browser/sync/glue/typed_url_change_processor.h" | 39 #include "chrome/browser/sync/glue/typed_url_change_processor.h" |
38 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" | 40 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" |
39 #include "chrome/browser/sync/glue/typed_url_model_associator.h" | 41 #include "chrome/browser/sync/glue/typed_url_model_associator.h" |
40 #include "chrome/browser/sync/profile_sync_service.h" | 42 #include "chrome/browser/sync/profile_sync_service.h" |
41 #include "chrome/browser/sync/profile_sync_factory_impl.h" | 43 #include "chrome/browser/sync/profile_sync_factory_impl.h" |
42 #include "chrome/browser/sync/syncable_service.h" | |
43 #include "chrome/browser/webdata/web_data_service.h" | 44 #include "chrome/browser/webdata/web_data_service.h" |
44 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
45 | 46 |
46 using browser_sync::AppChangeProcessor; | 47 using browser_sync::AppChangeProcessor; |
47 using browser_sync::AppDataTypeController; | 48 using browser_sync::AppDataTypeController; |
48 using browser_sync::AppModelAssociator; | 49 using browser_sync::AppModelAssociator; |
49 using browser_sync::AutofillChangeProcessor; | 50 using browser_sync::AutofillChangeProcessor; |
50 using browser_sync::AutofillProfileChangeProcessor; | 51 using browser_sync::AutofillProfileChangeProcessor; |
51 using browser_sync::AutofillDataTypeController; | 52 using browser_sync::AutofillDataTypeController; |
52 using browser_sync::AutofillProfileDataTypeController; | 53 using browser_sync::AutofillProfileDataTypeController; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 error_handler); | 268 error_handler); |
268 return SyncComponents(model_associator, change_processor); | 269 return SyncComponents(model_associator, change_processor); |
269 } | 270 } |
270 | 271 |
271 ProfileSyncFactory::SyncComponents | 272 ProfileSyncFactory::SyncComponents |
272 ProfileSyncFactoryImpl::CreatePreferenceSyncComponents( | 273 ProfileSyncFactoryImpl::CreatePreferenceSyncComponents( |
273 ProfileSyncService* profile_sync_service, | 274 ProfileSyncService* profile_sync_service, |
274 UnrecoverableErrorHandler* error_handler) { | 275 UnrecoverableErrorHandler* error_handler) { |
275 SyncableService* pref_sync_service = | 276 SyncableService* pref_sync_service = |
276 profile_->GetPrefs()->GetSyncableService(); | 277 profile_->GetPrefs()->GetSyncableService(); |
| 278 sync_api::UserShare* user_share = profile_sync_service->GetUserShare(); |
277 GenericChangeProcessor* change_processor = | 279 GenericChangeProcessor* change_processor = |
278 new GenericChangeProcessor(pref_sync_service, error_handler); | 280 new GenericChangeProcessor(pref_sync_service, error_handler, user_share); |
279 return SyncComponents(pref_sync_service, change_processor); | 281 browser_sync::SyncableServiceAdapter* sync_service_adapter = |
| 282 new browser_sync::SyncableServiceAdapter(syncable::PREFERENCES, |
| 283 pref_sync_service, |
| 284 change_processor); |
| 285 return SyncComponents(sync_service_adapter, change_processor); |
280 } | 286 } |
281 | 287 |
282 ProfileSyncFactory::SyncComponents | 288 ProfileSyncFactory::SyncComponents |
283 ProfileSyncFactoryImpl::CreateThemeSyncComponents( | 289 ProfileSyncFactoryImpl::CreateThemeSyncComponents( |
284 ProfileSyncService* profile_sync_service, | 290 ProfileSyncService* profile_sync_service, |
285 UnrecoverableErrorHandler* error_handler) { | 291 UnrecoverableErrorHandler* error_handler) { |
286 ThemeModelAssociator* model_associator = | 292 ThemeModelAssociator* model_associator = |
287 new ThemeModelAssociator(profile_sync_service); | 293 new ThemeModelAssociator(profile_sync_service); |
288 ThemeChangeProcessor* change_processor = | 294 ThemeChangeProcessor* change_processor = |
289 new ThemeChangeProcessor(error_handler); | 295 new ThemeChangeProcessor(error_handler); |
(...skipping 18 matching lines...) Expand all Loading... |
308 ProfileSyncFactory::SyncComponents | 314 ProfileSyncFactory::SyncComponents |
309 ProfileSyncFactoryImpl::CreateSessionSyncComponents( | 315 ProfileSyncFactoryImpl::CreateSessionSyncComponents( |
310 ProfileSyncService* profile_sync_service, | 316 ProfileSyncService* profile_sync_service, |
311 UnrecoverableErrorHandler* error_handler) { | 317 UnrecoverableErrorHandler* error_handler) { |
312 SessionModelAssociator* model_associator = | 318 SessionModelAssociator* model_associator = |
313 new SessionModelAssociator(profile_sync_service); | 319 new SessionModelAssociator(profile_sync_service); |
314 SessionChangeProcessor* change_processor = | 320 SessionChangeProcessor* change_processor = |
315 new SessionChangeProcessor(error_handler, model_associator); | 321 new SessionChangeProcessor(error_handler, model_associator); |
316 return SyncComponents(model_associator, change_processor); | 322 return SyncComponents(model_associator, change_processor); |
317 } | 323 } |
OLD | NEW |