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

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

Issue 307783002: Instantiate AttachmentDownloader and use it in AttachmentServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix components unittest Created 6 years, 6 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
« no previous file with comments | « no previous file | components/sync_driver/generic_change_processor_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/attachments/attachment_service_impl.h"
63 #include "sync/api/syncable_service.h" 63 #include "sync/api/syncable_service.h"
64 #include "sync/internal_api/public/attachments/fake_attachment_downloader.h"
64 #include "sync/internal_api/public/attachments/fake_attachment_store.h" 65 #include "sync/internal_api/public/attachments/fake_attachment_store.h"
65 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h" 66 #include "sync/internal_api/public/attachments/fake_attachment_uploader.h"
66 67
67 #if defined(ENABLE_EXTENSIONS) 68 #if defined(ENABLE_EXTENSIONS)
68 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" 69 #include "chrome/browser/extensions/api/storage/settings_sync_util.h"
69 #include "chrome/browser/extensions/extension_sync_service.h" 70 #include "chrome/browser/extensions/extension_sync_service.h"
70 #endif 71 #endif
71 72
72 #if defined(ENABLE_APP_LIST) 73 #if defined(ENABLE_APP_LIST)
73 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 74 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 // Bookmarks 563 // Bookmarks
563 // Typed URLs 564 // Typed URLs
564 NOTREACHED(); 565 NOTREACHED();
565 return base::WeakPtr<syncer::SyncableService>(); 566 return base::WeakPtr<syncer::SyncableService>();
566 } 567 }
567 } 568 }
568 569
569 scoped_ptr<syncer::AttachmentService> 570 scoped_ptr<syncer::AttachmentService>
570 ProfileSyncComponentsFactoryImpl::CreateAttachmentService( 571 ProfileSyncComponentsFactoryImpl::CreateAttachmentService(
571 syncer::AttachmentService::Delegate* delegate) { 572 syncer::AttachmentService::Delegate* delegate) {
572 // TODO(maniscalco): Use a shared (one per profile) thread-safe instance of 573 // TODO(maniscalco): Use a shared (one per profile) thread-safe instances of
573 // AttachmentUpload instead of creating a new one per AttachmentService (bug 574 // AttachmentUploader and AttachmentDownloader instead of creating a new one
574 // 369536). 575 // per AttachmentService (bug 369536).
575 scoped_ptr<syncer::AttachmentUploader> attachment_uploader( 576 scoped_ptr<syncer::AttachmentUploader> attachment_uploader(
576 new syncer::FakeAttachmentUploader); 577 new syncer::FakeAttachmentUploader);
578 scoped_ptr<syncer::AttachmentDownloader> attachment_downloader(
579 new syncer::FakeAttachmentDownloader());
577 580
578 scoped_ptr<syncer::AttachmentStore> attachment_store( 581 scoped_ptr<syncer::AttachmentStore> attachment_store(
579 new syncer::FakeAttachmentStore( 582 new syncer::FakeAttachmentStore(
580 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); 583 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)));
581 584
582 scoped_ptr<syncer::AttachmentService> attachment_service( 585 scoped_ptr<syncer::AttachmentService> attachment_service(
583 new syncer::AttachmentServiceImpl( 586 new syncer::AttachmentServiceImpl(attachment_store.Pass(),
584 attachment_store.Pass(), attachment_uploader.Pass(), delegate)); 587 attachment_uploader.Pass(),
588 attachment_downloader.Pass(),
589 delegate));
585 590
586 return attachment_service.Pass(); 591 return attachment_service.Pass();
587 } 592 }
588 593
589 ProfileSyncComponentsFactory::SyncComponents 594 ProfileSyncComponentsFactory::SyncComponents
590 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents( 595 ProfileSyncComponentsFactoryImpl::CreateBookmarkSyncComponents(
591 ProfileSyncService* profile_sync_service, 596 ProfileSyncService* profile_sync_service,
592 DataTypeErrorHandler* error_handler) { 597 DataTypeErrorHandler* error_handler) {
593 BookmarkModel* bookmark_model = 598 BookmarkModel* bookmark_model =
594 BookmarkModelFactory::GetForProfile(profile_sync_service->profile()); 599 BookmarkModelFactory::GetForProfile(profile_sync_service->profile());
(...skipping 26 matching lines...) Expand all
621 new TypedUrlModelAssociator(profile_sync_service, 626 new TypedUrlModelAssociator(profile_sync_service,
622 history_backend, 627 history_backend,
623 error_handler); 628 error_handler);
624 TypedUrlChangeProcessor* change_processor = 629 TypedUrlChangeProcessor* change_processor =
625 new TypedUrlChangeProcessor(profile_, 630 new TypedUrlChangeProcessor(profile_,
626 model_associator, 631 model_associator,
627 history_backend, 632 history_backend,
628 error_handler); 633 error_handler);
629 return SyncComponents(model_associator, change_processor); 634 return SyncComponents(model_associator, change_processor);
630 } 635 }
OLDNEW
« no previous file with comments | « no previous file | components/sync_driver/generic_change_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698