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

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

Issue 401433003: Revert of Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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"
11 #include "chrome/browser/history/history_service_factory.h" 11 #include "chrome/browser/history/history_service_factory.h"
12 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" 12 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
13 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac tory.h" 13 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service_fac tory.h"
14 #include "chrome/browser/password_manager/password_store_factory.h" 14 #include "chrome/browser/password_manager/password_store_factory.h"
15 #include "chrome/browser/pref_service_flags_storage.h" 15 #include "chrome/browser/pref_service_flags_storage.h"
16 #include "chrome/browser/prefs/pref_model_associator.h" 16 #include "chrome/browser/prefs/pref_model_associator.h"
17 #include "chrome/browser/prefs/pref_service_syncable.h" 17 #include "chrome/browser/prefs/pref_service_syncable.h"
18 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/search_engines/template_url_service_factory.h" 19 #include "chrome/browser/search_engines/template_url_service_factory.h"
20 #include "chrome/browser/signin/signin_manager_factory.h" 20 #include "chrome/browser/signin/signin_manager_factory.h"
21 #include "chrome/browser/sync/glue/autofill_data_type_controller.h" 21 #include "chrome/browser/sync/glue/autofill_data_type_controller.h"
22 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h" 22 #include "chrome/browser/sync/glue/autofill_profile_data_type_controller.h"
23 #include "chrome/browser/sync/glue/bookmark_change_processor.h" 23 #include "chrome/browser/sync/glue/bookmark_change_processor.h"
24 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h" 24 #include "chrome/browser/sync/glue/bookmark_data_type_controller.h"
25 #include "chrome/browser/sync/glue/bookmark_model_associator.h" 25 #include "chrome/browser/sync/glue/bookmark_model_associator.h"
26 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" 26 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h"
27 #include "chrome/browser/sync/glue/extension_backed_data_type_controller.h" 27 #include "chrome/browser/sync/glue/extension_backed_data_type_controller.h"
28 #include "chrome/browser/sync/glue/extension_data_type_controller.h" 28 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
29 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" 29 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h"
30 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h"
31 #include "chrome/browser/sync/glue/password_data_type_controller.h" 30 #include "chrome/browser/sync/glue/password_data_type_controller.h"
32 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h" 31 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h"
33 #include "chrome/browser/sync/glue/sync_backend_host.h" 32 #include "chrome/browser/sync/glue/sync_backend_host.h"
34 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" 33 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
35 #include "chrome/browser/sync/glue/theme_data_type_controller.h" 34 #include "chrome/browser/sync/glue/theme_data_type_controller.h"
36 #include "chrome/browser/sync/glue/typed_url_change_processor.h" 35 #include "chrome/browser/sync/glue/typed_url_change_processor.h"
37 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" 36 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h"
38 #include "chrome/browser/sync/glue/typed_url_model_associator.h" 37 #include "chrome/browser/sync/glue/typed_url_model_associator.h"
39 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" 38 #include "chrome/browser/sync/profile_sync_components_factory_impl.h"
40 #include "chrome/browser/sync/profile_sync_service.h" 39 #include "chrome/browser/sync/profile_sync_service.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 this)); 243 this));
245 } 244 }
246 245
247 // Session sync is enabled by default. Register unless explicitly disabled. 246 // Session sync is enabled by default. Register unless explicitly disabled.
248 if (!disabled_types.Has(syncer::PROXY_TABS)) { 247 if (!disabled_types.Has(syncer::PROXY_TABS)) {
249 pss->RegisterDataTypeController(new ProxyDataTypeController( 248 pss->RegisterDataTypeController(new ProxyDataTypeController(
250 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 249 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
251 syncer::PROXY_TABS)); 250 syncer::PROXY_TABS));
252 pss->RegisterDataTypeController( 251 pss->RegisterDataTypeController(
253 new SessionDataTypeController( 252 new SessionDataTypeController(
254 this, 253 this, profile_, MakeDisableCallbackFor(syncer::SESSIONS)));
255 profile_,
256 pss->GetSyncedWindowDelegatesGetter(),
257 pss->GetLocalDeviceInfoProvider(),
258 MakeDisableCallbackFor(syncer::SESSIONS)));
259 } 254 }
260 255
261 // Favicon sync is enabled by default. Register unless explicitly disabled. 256 // Favicon sync is enabled by default. Register unless explicitly disabled.
262 if (!disabled_types.Has(syncer::FAVICON_IMAGES) && 257 if (!disabled_types.Has(syncer::FAVICON_IMAGES) &&
263 !disabled_types.Has(syncer::FAVICON_TRACKING)) { 258 !disabled_types.Has(syncer::FAVICON_TRACKING)) {
264 pss->RegisterDataTypeController( 259 pss->RegisterDataTypeController(
265 new UIDataTypeController( 260 new UIDataTypeController(
266 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 261 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
267 base::Bind(&ChromeReportUnrecoverableError), 262 base::Bind(&ChromeReportUnrecoverableError),
268 MakeDisableCallbackFor(syncer::FAVICON_IMAGES), 263 MakeDisableCallbackFor(syncer::FAVICON_IMAGES),
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 ProfileSyncComponentsFactoryImpl::CreateSyncBackendHost( 460 ProfileSyncComponentsFactoryImpl::CreateSyncBackendHost(
466 const std::string& name, 461 const std::string& name,
467 Profile* profile, 462 Profile* profile,
468 invalidation::InvalidationService* invalidator, 463 invalidation::InvalidationService* invalidator,
469 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, 464 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs,
470 const base::FilePath& sync_folder) { 465 const base::FilePath& sync_folder) {
471 return new browser_sync::SyncBackendHostImpl(name, profile, invalidator, 466 return new browser_sync::SyncBackendHostImpl(name, profile, invalidator,
472 sync_prefs, sync_folder); 467 sync_prefs, sync_folder);
473 } 468 }
474 469
475 scoped_ptr<browser_sync::LocalDeviceInfoProvider>
476 ProfileSyncComponentsFactoryImpl::CreateLocalDeviceInfoProvider() {
477 return scoped_ptr<browser_sync::LocalDeviceInfoProvider>(
478 new browser_sync::LocalDeviceInfoProviderImpl());
479 }
480
481 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: 470 base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl::
482 GetSyncableServiceForType(syncer::ModelType type) { 471 GetSyncableServiceForType(syncer::ModelType type) {
483 if (!profile_) { // For tests. 472 if (!profile_) { // For tests.
484 return base::WeakPtr<syncer::SyncableService>(); 473 return base::WeakPtr<syncer::SyncableService>();
485 } 474 }
486 switch (type) { 475 switch (type) {
487 case syncer::PREFERENCES: 476 case syncer::PREFERENCES:
488 return PrefServiceSyncable::FromProfile( 477 return PrefServiceSyncable::FromProfile(
489 profile_)->GetSyncableService(syncer::PREFERENCES)->AsWeakPtr(); 478 profile_)->GetSyncableService(syncer::PREFERENCES)->AsWeakPtr();
490 case syncer::PRIORITY_PREFERENCES: 479 case syncer::PRIORITY_PREFERENCES:
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 new TypedUrlModelAssociator(profile_sync_service, 707 new TypedUrlModelAssociator(profile_sync_service,
719 history_backend, 708 history_backend,
720 error_handler); 709 error_handler);
721 TypedUrlChangeProcessor* change_processor = 710 TypedUrlChangeProcessor* change_processor =
722 new TypedUrlChangeProcessor(profile_, 711 new TypedUrlChangeProcessor(profile_,
723 model_associator, 712 model_associator,
724 history_backend, 713 history_backend,
725 error_handler); 714 error_handler);
726 return SyncComponents(model_associator, change_processor); 715 return SyncComponents(model_associator, change_processor);
727 } 716 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698