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 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 8 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 9 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
10 #include "chrome/browser/history/history_service.h" | 10 #include "chrome/browser/history/history_service.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "chrome/common/chrome_version_info.h" | 56 #include "chrome/common/chrome_version_info.h" |
57 #include "chrome/common/pref_names.h" | 57 #include "chrome/common/pref_names.h" |
58 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" | 58 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" |
59 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 59 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
60 #include "components/dom_distiller/core/dom_distiller_service.h" | 60 #include "components/dom_distiller/core/dom_distiller_service.h" |
61 #include "components/password_manager/core/browser/password_store.h" | 61 #include "components/password_manager/core/browser/password_store.h" |
62 #include "components/sync_driver/data_type_manager_observer.h" | 62 #include "components/sync_driver/data_type_manager_observer.h" |
63 #include "components/sync_driver/proxy_data_type_controller.h" | 63 #include "components/sync_driver/proxy_data_type_controller.h" |
64 #include "content/public/browser/browser_thread.h" | 64 #include "content/public/browser/browser_thread.h" |
65 #include "extensions/browser/extension_system.h" | 65 #include "extensions/browser/extension_system.h" |
| 66 #include "sync/api/attachments/attachment_service.h" |
| 67 #include "sync/api/attachments/fake_attachment_service.h" |
| 68 #include "sync/api/attachments/fake_attachment_store.h" |
66 #include "sync/api/syncable_service.h" | 69 #include "sync/api/syncable_service.h" |
67 | 70 |
68 #if defined(ENABLE_EXTENSIONS) | 71 #if defined(ENABLE_EXTENSIONS) |
69 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" | 72 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" |
70 #include "chrome/browser/extensions/extension_sync_service.h" | 73 #include "chrome/browser/extensions/extension_sync_service.h" |
71 #endif | 74 #endif |
72 | 75 |
73 #if defined(ENABLE_MANAGED_USERS) | 76 #if defined(ENABLE_MANAGED_USERS) |
74 #include "chrome/browser/managed_mode/managed_user_settings_service.h" | 77 #include "chrome/browser/managed_mode/managed_user_settings_service.h" |
75 #include "chrome/browser/managed_mode/managed_user_settings_service_factory.h" | 78 #include "chrome/browser/managed_mode/managed_user_settings_service_factory.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 return new browser_sync::SyncBackendHostImpl(name, profile, sync_prefs); | 440 return new browser_sync::SyncBackendHostImpl(name, profile, sync_prefs); |
438 } | 441 } |
439 | 442 |
440 browser_sync::GenericChangeProcessor* | 443 browser_sync::GenericChangeProcessor* |
441 ProfileSyncComponentsFactoryImpl::CreateGenericChangeProcessor( | 444 ProfileSyncComponentsFactoryImpl::CreateGenericChangeProcessor( |
442 ProfileSyncService* profile_sync_service, | 445 ProfileSyncService* profile_sync_service, |
443 browser_sync::DataTypeErrorHandler* error_handler, | 446 browser_sync::DataTypeErrorHandler* error_handler, |
444 const base::WeakPtr<syncer::SyncableService>& local_service, | 447 const base::WeakPtr<syncer::SyncableService>& local_service, |
445 const base::WeakPtr<syncer::SyncMergeResult>& merge_result) { | 448 const base::WeakPtr<syncer::SyncMergeResult>& merge_result) { |
446 syncer::UserShare* user_share = profile_sync_service->GetUserShare(); | 449 syncer::UserShare* user_share = profile_sync_service->GetUserShare(); |
447 return new GenericChangeProcessor(error_handler, | 450 // TODO(maniscalco): Replace FakeAttachmentService with a real |
448 local_service, | 451 // AttachmentService implementation once it has been implemented (bug 356359). |
449 merge_result, | 452 scoped_ptr<syncer::AttachmentStore> attachment_store( |
450 user_share); | 453 new syncer::FakeAttachmentStore( |
| 454 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
| 455 scoped_ptr<syncer::AttachmentService> attachment_service( |
| 456 new syncer::FakeAttachmentService(attachment_store.Pass())); |
| 457 return new GenericChangeProcessor( |
| 458 error_handler, |
| 459 local_service, |
| 460 merge_result, |
| 461 user_share, |
| 462 attachment_service.Pass()); |
451 } | 463 } |
452 | 464 |
453 browser_sync::SharedChangeProcessor* ProfileSyncComponentsFactoryImpl:: | 465 browser_sync::SharedChangeProcessor* ProfileSyncComponentsFactoryImpl:: |
454 CreateSharedChangeProcessor() { | 466 CreateSharedChangeProcessor() { |
455 return new SharedChangeProcessor(); | 467 return new SharedChangeProcessor(); |
456 } | 468 } |
457 | 469 |
458 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: | 470 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: |
459 GetSyncableServiceForType(syncer::ModelType type) { | 471 GetSyncableServiceForType(syncer::ModelType type) { |
460 if (!profile_) { // For tests. | 472 if (!profile_) { // For tests. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 ProfileSyncComponentsFactory::SyncComponents | 637 ProfileSyncComponentsFactory::SyncComponents |
626 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( | 638 ProfileSyncComponentsFactoryImpl::CreateSessionSyncComponents( |
627 ProfileSyncService* profile_sync_service, | 639 ProfileSyncService* profile_sync_service, |
628 DataTypeErrorHandler* error_handler) { | 640 DataTypeErrorHandler* error_handler) { |
629 SessionModelAssociator* model_associator = | 641 SessionModelAssociator* model_associator = |
630 new SessionModelAssociator(profile_sync_service, error_handler); | 642 new SessionModelAssociator(profile_sync_service, error_handler); |
631 SessionChangeProcessor* change_processor = | 643 SessionChangeProcessor* change_processor = |
632 new SessionChangeProcessor(error_handler, model_associator); | 644 new SessionChangeProcessor(error_handler, model_associator); |
633 return SyncComponents(model_associator, change_processor); | 645 return SyncComponents(model_associator, change_processor); |
634 } | 646 } |
OLD | NEW |