OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/sync/chrome_sync_client.h" | 5 #include "chrome/browser/sync/chrome_sync_client.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 #include "components/sync/driver/glue/ui_model_worker.h" | 59 #include "components/sync/driver/glue/ui_model_worker.h" |
60 #include "components/sync/driver/sync_api_component_factory.h" | 60 #include "components/sync/driver/sync_api_component_factory.h" |
61 #include "components/sync/driver/sync_util.h" | 61 #include "components/sync/driver/sync_util.h" |
62 #include "components/sync/driver/ui_data_type_controller.h" | 62 #include "components/sync/driver/ui_data_type_controller.h" |
63 #include "components/sync/engine/passive_model_worker.h" | 63 #include "components/sync/engine/passive_model_worker.h" |
64 #include "components/sync_sessions/sync_sessions_client.h" | 64 #include "components/sync_sessions/sync_sessions_client.h" |
65 #include "components/syncable_prefs/pref_service_syncable.h" | 65 #include "components/syncable_prefs/pref_service_syncable.h" |
66 #include "content/public/browser/browser_thread.h" | 66 #include "content/public/browser/browser_thread.h" |
67 #include "ui/base/device_form_factor.h" | 67 #include "ui/base/device_form_factor.h" |
68 | 68 |
69 #if defined(ENABLE_APP_LIST) | 69 #if BUILDFLAG(ENABLE_APP_LIST) |
70 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 70 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
71 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 71 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
72 #include "ui/app_list/app_list_switches.h" | 72 #include "ui/app_list/app_list_switches.h" |
73 #endif | 73 #endif |
74 | 74 |
75 #if defined(ENABLE_EXTENSIONS) | 75 #if defined(ENABLE_EXTENSIONS) |
76 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" | 76 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" |
77 #include "chrome/browser/extensions/extension_sync_service.h" | 77 #include "chrome/browser/extensions/extension_sync_service.h" |
78 #include "chrome/browser/sync/glue/extension_data_type_controller.h" | 78 #include "chrome/browser/sync/glue/extension_data_type_controller.h" |
79 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" | 79 #include "chrome/browser/sync/glue/extension_setting_data_type_controller.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 return TemplateURLServiceFactory::GetForProfile(profile_)->AsWeakPtr(); | 331 return TemplateURLServiceFactory::GetForProfile(profile_)->AsWeakPtr(); |
332 #if defined(ENABLE_EXTENSIONS) | 332 #if defined(ENABLE_EXTENSIONS) |
333 case syncer::APPS: | 333 case syncer::APPS: |
334 case syncer::EXTENSIONS: | 334 case syncer::EXTENSIONS: |
335 return ExtensionSyncService::Get(profile_)->AsWeakPtr(); | 335 return ExtensionSyncService::Get(profile_)->AsWeakPtr(); |
336 case syncer::APP_SETTINGS: | 336 case syncer::APP_SETTINGS: |
337 case syncer::EXTENSION_SETTINGS: | 337 case syncer::EXTENSION_SETTINGS: |
338 return extensions::settings_sync_util::GetSyncableService(profile_, type) | 338 return extensions::settings_sync_util::GetSyncableService(profile_, type) |
339 ->AsWeakPtr(); | 339 ->AsWeakPtr(); |
340 #endif | 340 #endif |
341 #if defined(ENABLE_APP_LIST) | 341 #if BUILDFLAG(ENABLE_APP_LIST) |
342 case syncer::APP_LIST: | 342 case syncer::APP_LIST: |
343 return app_list::AppListSyncableServiceFactory::GetForProfile(profile_)-> | 343 return app_list::AppListSyncableServiceFactory::GetForProfile(profile_)-> |
344 AsWeakPtr(); | 344 AsWeakPtr(); |
345 #endif | 345 #endif |
346 #if defined(ENABLE_THEMES) | 346 #if defined(ENABLE_THEMES) |
347 case syncer::THEMES: | 347 case syncer::THEMES: |
348 return ThemeServiceFactory::GetForProfile(profile_)-> | 348 return ThemeServiceFactory::GetForProfile(profile_)-> |
349 GetThemeSyncableService()->AsWeakPtr(); | 349 GetThemeSyncableService()->AsWeakPtr(); |
350 #endif | 350 #endif |
351 case syncer::HISTORY_DELETE_DIRECTIVES: { | 351 case syncer::HISTORY_DELETE_DIRECTIVES: { |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 | 562 |
563 // App setting sync is enabled by default. Register unless explicitly | 563 // App setting sync is enabled by default. Register unless explicitly |
564 // disabled. | 564 // disabled. |
565 if (!disabled_types.Has(syncer::APP_SETTINGS)) { | 565 if (!disabled_types.Has(syncer::APP_SETTINGS)) { |
566 sync_service->RegisterDataTypeController( | 566 sync_service->RegisterDataTypeController( |
567 base::MakeUnique<ExtensionSettingDataTypeController>( | 567 base::MakeUnique<ExtensionSettingDataTypeController>( |
568 syncer::APP_SETTINGS, error_callback, this, profile_)); | 568 syncer::APP_SETTINGS, error_callback, this, profile_)); |
569 } | 569 } |
570 #endif | 570 #endif |
571 | 571 |
572 #if defined(ENABLE_APP_LIST) | 572 #if BUILDFLAG(ENABLE_APP_LIST) |
573 if (app_list::switches::IsAppListSyncEnabled()) { | 573 if (app_list::switches::IsAppListSyncEnabled()) { |
574 sync_service->RegisterDataTypeController( | 574 sync_service->RegisterDataTypeController( |
575 base::MakeUnique<UIDataTypeController>(syncer::APP_LIST, error_callback, | 575 base::MakeUnique<UIDataTypeController>(syncer::APP_LIST, error_callback, |
576 this)); | 576 this)); |
577 } | 577 } |
578 #endif | 578 #endif |
579 | 579 |
580 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) | 580 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) |
581 // Dictionary sync is enabled by default. | 581 // Dictionary sync is enabled by default. |
582 if (!disabled_types.Has(syncer::DICTIONARY)) { | 582 if (!disabled_types.Has(syncer::DICTIONARY)) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 sync_service->RegisterDataTypeController( | 627 sync_service->RegisterDataTypeController( |
628 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 628 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
629 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 629 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
630 sync_service->RegisterDataTypeController( | 630 sync_service->RegisterDataTypeController( |
631 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 631 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
632 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 632 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
633 #endif | 633 #endif |
634 } | 634 } |
635 | 635 |
636 } // namespace browser_sync | 636 } // namespace browser_sync |
OLD | NEW |