Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: chrome/browser/sync/profile_sync_components_factory_impl.cc

Issue 272043002: Invoke AttachmentUploader and update AttachmentIds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android build Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "components/dom_distiller/core/dom_distiller_service.h" 52 #include "components/dom_distiller/core/dom_distiller_service.h"
53 #include "components/password_manager/core/browser/password_store.h" 53 #include "components/password_manager/core/browser/password_store.h"
54 #include "components/signin/core/browser/signin_manager.h" 54 #include "components/signin/core/browser/signin_manager.h"
55 #include "components/sync_driver/data_type_manager_impl.h" 55 #include "components/sync_driver/data_type_manager_impl.h"
56 #include "components/sync_driver/data_type_manager_observer.h" 56 #include "components/sync_driver/data_type_manager_observer.h"
57 #include "components/sync_driver/generic_change_processor.h" 57 #include "components/sync_driver/generic_change_processor.h"
58 #include "components/sync_driver/proxy_data_type_controller.h" 58 #include "components/sync_driver/proxy_data_type_controller.h"
59 #include "content/public/browser/browser_thread.h" 59 #include "content/public/browser/browser_thread.h"
60 #include "extensions/browser/extension_system.h" 60 #include "extensions/browser/extension_system.h"
61 #include "sync/api/attachments/attachment_service.h" 61 #include "sync/api/attachments/attachment_service.h"
62 #include "sync/api/attachments/attachment_service_impl.h"
62 #include "sync/api/syncable_service.h" 63 #include "sync/api/syncable_service.h"
63 #include "sync/internal_api/public/attachments/fake_attachment_store.h" 64 #include "sync/internal_api/public/attachments/fake_attachment_store.h"
65 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h"
64 66
65 #if defined(ENABLE_EXTENSIONS) 67 #if defined(ENABLE_EXTENSIONS)
66 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" 68 #include "chrome/browser/extensions/api/storage/settings_sync_util.h"
67 #include "chrome/browser/extensions/extension_sync_service.h" 69 #include "chrome/browser/extensions/extension_sync_service.h"
68 #endif 70 #endif
69 71
70 #if defined(ENABLE_APP_LIST) 72 #if defined(ENABLE_APP_LIST)
71 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 73 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
72 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 74 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
73 #include "ui/app_list/app_list_switches.h" 75 #include "ui/app_list/app_list_switches.h"
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 default: 559 default:
558 // The following datatypes still need to be transitioned to the 560 // The following datatypes still need to be transitioned to the
559 // syncer::SyncableService API: 561 // syncer::SyncableService API:
560 // Bookmarks 562 // Bookmarks
561 // Typed URLs 563 // Typed URLs
562 NOTREACHED(); 564 NOTREACHED();
563 return base::WeakPtr<syncer::SyncableService>(); 565 return base::WeakPtr<syncer::SyncableService>();
564 } 566 }
565 } 567 }
566 568
567 scoped_ptr<syncer::AttachmentStore> 569 scoped_ptr<syncer::AttachmentService>
568 ProfileSyncComponentsFactoryImpl::CreateCustomAttachmentStoreForType( 570 ProfileSyncComponentsFactoryImpl::CreateAttachmentService(
569 syncer::ModelType type) { 571 syncer::AttachmentService::Delegate* delegate) {
570 scoped_ptr<syncer::AttachmentStore> store( 572 // TODO(maniscalco): Use a shared (one per profile) thread-safe instance of
573 // AttachmentUpload instead of creating a new one per AttachmentService (bug
574 // 369536).
575 scoped_ptr<syncer::AttachmentUploader> attachment_uploader(
576 new syncer::FakeAttachmentUploader);
577
578 scoped_ptr<syncer::AttachmentStore> attachment_store(
571 new syncer::FakeAttachmentStore( 579 new syncer::FakeAttachmentStore(
572 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 580 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
573 return store.Pass(); 581
582 scoped_ptr<syncer::AttachmentService> attachment_service(
583 new syncer::AttachmentServiceImpl(
584 attachment_store.Pass(), attachment_uploader.Pass(), delegate));
585
586 return attachment_service.Pass();
574 } 587 }
575 588
576 ProfileSyncComponentsFactory::SyncComponents 589 ProfileSyncComponentsFactory::SyncComponents
577 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents( 590 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents(
578 ProfileSyncService* profile_sync_service, 591 ProfileSyncService* profile_sync_service,
579 DataTypeErrorHandler* error_handler) { 592 DataTypeErrorHandler* error_handler) {
580 BookmarkModel* bookmark_model = 593 BookmarkModel* bookmark_model =
581 BookmarkModelFactory::GetForProfile(profile_sync_service->profile()); 594 BookmarkModelFactory::GetForProfile(profile_sync_service->profile());
582 syncer::UserShare* user_share = profile_sync_service->GetUserShare(); 595 syncer::UserShare* user_share = profile_sync_service->GetUserShare();
583 // TODO(akalin): We may want to propagate this switch up eventually. 596 // TODO(akalin): We may want to propagate this switch up eventually.
(...skipping 24 matching lines...) Expand all
608 new TypedUrlModelAssociator(profile_sync_service, 621 new TypedUrlModelAssociator(profile_sync_service,
609 history_backend, 622 history_backend,
610 error_handler); 623 error_handler);
611 TypedUrlChangeProcessor* change_processor = 624 TypedUrlChangeProcessor* change_processor =
612 new TypedUrlChangeProcessor(profile_, 625 new TypedUrlChangeProcessor(profile_,
613 model_associator, 626 model_associator,
614 history_backend, 627 history_backend,
615 error_handler); 628 error_handler);
616 return SyncComponents(model_associator, change_processor); 629 return SyncComponents(model_associator, change_processor);
617 } 630 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_components_factory_impl.h ('k') | chrome/browser/sync/profile_sync_components_factory_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698