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

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

Issue 661053002: Cleanup: Put more media and profile extensions code behind ENABLE_EXTENSIONS ifdefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 2 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"
28 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
29 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h"
30 #include "chrome/browser/sync/glue/history_delete_directives_data_type_controlle r.h" 27 #include "chrome/browser/sync/glue/history_delete_directives_data_type_controlle r.h"
31 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h" 28 #include "chrome/browser/sync/glue/local_device_info_provider_impl.h"
32 #include "chrome/browser/sync/glue/password_data_type_controller.h" 29 #include "chrome/browser/sync/glue/password_data_type_controller.h"
33 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h" 30 #include "chrome/browser/sync/glue/search_engine_data_type_controller.h"
34 #include "chrome/browser/sync/glue/sync_backend_host.h" 31 #include "chrome/browser/sync/glue/sync_backend_host.h"
35 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" 32 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
36 #include "chrome/browser/sync/glue/theme_data_type_controller.h" 33 #include "chrome/browser/sync/glue/theme_data_type_controller.h"
37 #include "chrome/browser/sync/glue/typed_url_change_processor.h" 34 #include "chrome/browser/sync/glue/typed_url_change_processor.h"
38 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h" 35 #include "chrome/browser/sync/glue/typed_url_data_type_controller.h"
39 #include "chrome/browser/sync/glue/typed_url_model_associator.h" 36 #include "chrome/browser/sync/glue/typed_url_model_associator.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #if defined(ENABLE_APP_LIST) 71 #if defined(ENABLE_APP_LIST)
75 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 72 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
76 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 73 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
77 #include "ui/app_list/app_list_switches.h" 74 #include "ui/app_list/app_list_switches.h"
78 #endif 75 #endif
79 76
80 #if defined(ENABLE_EXTENSIONS) 77 #if defined(ENABLE_EXTENSIONS)
81 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" 78 #include "chrome/browser/extensions/api/storage/settings_sync_util.h"
82 #include "chrome/browser/extensions/api/synced_notifications_private/synced_noti fications_shim.h" 79 #include "chrome/browser/extensions/api/synced_notifications_private/synced_noti fications_shim.h"
83 #include "chrome/browser/extensions/extension_sync_service.h" 80 #include "chrome/browser/extensions/extension_sync_service.h"
81 #include "chrome/browser/sync/glue/extension_backed_data_type_controller.h"
82 #include "chrome/browser/sync/glue/extension_data_type_controller.h"
83 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h"
84 #endif 84 #endif
85 85
86 #if defined(ENABLE_MANAGED_USERS) 86 #if defined(ENABLE_MANAGED_USERS)
87 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" 87 #include "chrome/browser/supervised_user/supervised_user_settings_service.h"
88 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" 88 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h"
89 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service .h" 89 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service .h"
90 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service _factory.h" 90 #include "chrome/browser/supervised_user/supervised_user_shared_settings_service _factory.h"
91 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll er.h" 91 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll er.h"
92 #include "chrome/browser/supervised_user/supervised_user_sync_service.h" 92 #include "chrome/browser/supervised_user/supervised_user_sync_service.h"
93 #include "chrome/browser/supervised_user/supervised_user_sync_service_factory.h" 93 #include "chrome/browser/supervised_user/supervised_user_sync_service_factory.h"
94 #endif 94 #endif
95 95
96 #if defined(ENABLE_SPELLCHECK) 96 #if defined(ENABLE_SPELLCHECK)
97 #include "chrome/browser/spellchecker/spellcheck_factory.h" 97 #include "chrome/browser/spellchecker/spellcheck_factory.h"
98 #include "chrome/browser/spellchecker/spellcheck_service.h" 98 #include "chrome/browser/spellchecker/spellcheck_service.h"
99 #endif 99 #endif
100 100
101 using browser_sync::AutofillDataTypeController; 101 using browser_sync::AutofillDataTypeController;
102 using browser_sync::AutofillProfileDataTypeController; 102 using browser_sync::AutofillProfileDataTypeController;
103 using browser_sync::BookmarkChangeProcessor; 103 using browser_sync::BookmarkChangeProcessor;
104 using browser_sync::BookmarkDataTypeController; 104 using browser_sync::BookmarkDataTypeController;
105 using browser_sync::BookmarkModelAssociator; 105 using browser_sync::BookmarkModelAssociator;
106 using browser_sync::ChromeReportUnrecoverableError; 106 using browser_sync::ChromeReportUnrecoverableError;
107 #if defined(ENABLE_EXTENSIONS)
107 using browser_sync::ExtensionBackedDataTypeController; 108 using browser_sync::ExtensionBackedDataTypeController;
108 using browser_sync::ExtensionDataTypeController; 109 using browser_sync::ExtensionDataTypeController;
109 using browser_sync::ExtensionSettingDataTypeController; 110 using browser_sync::ExtensionSettingDataTypeController;
111 #endif
110 using browser_sync::HistoryDeleteDirectivesDataTypeController; 112 using browser_sync::HistoryDeleteDirectivesDataTypeController;
111 using browser_sync::PasswordDataTypeController; 113 using browser_sync::PasswordDataTypeController;
112 using browser_sync::SearchEngineDataTypeController; 114 using browser_sync::SearchEngineDataTypeController;
113 using browser_sync::SessionDataTypeController; 115 using browser_sync::SessionDataTypeController;
114 using browser_sync::SyncBackendHost; 116 using browser_sync::SyncBackendHost;
115 using browser_sync::ThemeDataTypeController; 117 using browser_sync::ThemeDataTypeController;
116 using browser_sync::TypedUrlChangeProcessor; 118 using browser_sync::TypedUrlChangeProcessor;
117 using browser_sync::TypedUrlDataTypeController; 119 using browser_sync::TypedUrlDataTypeController;
118 using browser_sync::TypedUrlModelAssociator; 120 using browser_sync::TypedUrlModelAssociator;
119 using content::BrowserThread; 121 using content::BrowserThread;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 298 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
297 base::Bind(&ChromeReportUnrecoverableError), 299 base::Bind(&ChromeReportUnrecoverableError),
298 syncer::ENHANCED_BOOKMARKS, this)); 300 syncer::ENHANCED_BOOKMARKS, this));
299 } 301 }
300 } 302 }
301 303
302 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes( 304 void ProfileSyncComponentsFactoryImpl::RegisterDesktopDataTypes(
303 syncer::ModelTypeSet disabled_types, 305 syncer::ModelTypeSet disabled_types,
304 syncer::ModelTypeSet enabled_types, 306 syncer::ModelTypeSet enabled_types,
305 ProfileSyncService* pss) { 307 ProfileSyncService* pss) {
308 #if defined(ENABLE_EXTENSIONS)
306 // App sync is enabled by default. Register unless explicitly 309 // App sync is enabled by default. Register unless explicitly
307 // disabled. 310 // disabled.
308 if (!disabled_types.Has(syncer::APPS)) { 311 if (!disabled_types.Has(syncer::APPS)) {
309 pss->RegisterDataTypeController( 312 pss->RegisterDataTypeController(
310 new ExtensionDataTypeController(syncer::APPS, this, profile_)); 313 new ExtensionDataTypeController(syncer::APPS, this, profile_));
311 } 314 }
312 315
313 // Extension sync is enabled by default. Register unless explicitly 316 // Extension sync is enabled by default. Register unless explicitly
314 // disabled. 317 // disabled.
315 if (!disabled_types.Has(syncer::EXTENSIONS)) { 318 if (!disabled_types.Has(syncer::EXTENSIONS)) {
316 pss->RegisterDataTypeController( 319 pss->RegisterDataTypeController(
317 new ExtensionDataTypeController(syncer::EXTENSIONS, this, profile_)); 320 new ExtensionDataTypeController(syncer::EXTENSIONS, this, profile_));
318 } 321 }
322 #endif
319 323
320 // Preference sync is enabled by default. Register unless explicitly 324 // Preference sync is enabled by default. Register unless explicitly
321 // disabled. 325 // disabled.
322 if (!disabled_types.Has(syncer::PREFERENCES)) { 326 if (!disabled_types.Has(syncer::PREFERENCES)) {
323 pss->RegisterDataTypeController( 327 pss->RegisterDataTypeController(
324 new UIDataTypeController( 328 new UIDataTypeController(
325 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 329 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
326 base::Bind(&ChromeReportUnrecoverableError), 330 base::Bind(&ChromeReportUnrecoverableError),
327 syncer::PREFERENCES, 331 syncer::PREFERENCES,
328 this)); 332 this));
(...skipping 16 matching lines...) Expand all
345 } 349 }
346 #endif 350 #endif
347 351
348 // Search Engine sync is enabled by default. Register unless explicitly 352 // Search Engine sync is enabled by default. Register unless explicitly
349 // disabled. 353 // disabled.
350 if (!disabled_types.Has(syncer::SEARCH_ENGINES)) { 354 if (!disabled_types.Has(syncer::SEARCH_ENGINES)) {
351 pss->RegisterDataTypeController( 355 pss->RegisterDataTypeController(
352 new SearchEngineDataTypeController(this, profile_)); 356 new SearchEngineDataTypeController(this, profile_));
353 } 357 }
354 358
359 #if defined(ENABLE_EXTENSIONS)
355 // Extension setting sync is enabled by default. Register unless explicitly 360 // Extension setting sync is enabled by default. Register unless explicitly
356 // disabled. 361 // disabled.
357 if (!disabled_types.Has(syncer::EXTENSION_SETTINGS)) { 362 if (!disabled_types.Has(syncer::EXTENSION_SETTINGS)) {
358 pss->RegisterDataTypeController(new ExtensionSettingDataTypeController( 363 pss->RegisterDataTypeController(new ExtensionSettingDataTypeController(
359 syncer::EXTENSION_SETTINGS, this, profile_)); 364 syncer::EXTENSION_SETTINGS, this, profile_));
360 } 365 }
361 366
362 // App setting sync is enabled by default. Register unless explicitly 367 // App setting sync is enabled by default. Register unless explicitly
363 // disabled. 368 // disabled.
364 if (!disabled_types.Has(syncer::APP_SETTINGS)) { 369 if (!disabled_types.Has(syncer::APP_SETTINGS)) {
365 pss->RegisterDataTypeController(new ExtensionSettingDataTypeController( 370 pss->RegisterDataTypeController(new ExtensionSettingDataTypeController(
366 syncer::APP_SETTINGS, this, profile_)); 371 syncer::APP_SETTINGS, this, profile_));
367 } 372 }
373 #endif
368 374
369 #if defined(ENABLE_APP_LIST) 375 #if defined(ENABLE_APP_LIST)
370 if (app_list::switches::IsAppListSyncEnabled()) { 376 if (app_list::switches::IsAppListSyncEnabled()) {
371 pss->RegisterDataTypeController( 377 pss->RegisterDataTypeController(
372 new UIDataTypeController( 378 new UIDataTypeController(
373 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 379 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
374 base::Bind(&ChromeReportUnrecoverableError), 380 base::Bind(&ChromeReportUnrecoverableError),
375 syncer::APP_LIST, 381 syncer::APP_LIST,
376 this)); 382 this));
377 } 383 }
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 new TypedUrlModelAssociator(profile_sync_service, 714 new TypedUrlModelAssociator(profile_sync_service,
709 history_backend, 715 history_backend,
710 error_handler); 716 error_handler);
711 TypedUrlChangeProcessor* change_processor = 717 TypedUrlChangeProcessor* change_processor =
712 new TypedUrlChangeProcessor(profile_, 718 new TypedUrlChangeProcessor(profile_,
713 model_associator, 719 model_associator,
714 history_backend, 720 history_backend,
715 error_handler); 721 error_handler);
716 return SyncComponents(model_associator, change_processor); 722 return SyncComponents(model_associator, change_processor);
717 } 723 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698