| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 23 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
| 26 #include "chrome/browser/search_engines/template_url_service_factory.h" | 26 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 28 #include "chrome/browser/sync/glue/sync_start_util.h" | 28 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 29 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | 29 #include "chrome/browser/sync/glue/theme_data_type_controller.h" |
| 30 #include "chrome/browser/sync/profile_sync_service_factory.h" | 30 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 31 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h" | 31 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router.h" |
| 32 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory
.h" | 32 #include "chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory
.h" |
| 33 #include "chrome/browser/sync/user_event_service_factory.h" |
| 33 #include "chrome/browser/themes/theme_service.h" | 34 #include "chrome/browser/themes/theme_service.h" |
| 34 #include "chrome/browser/themes/theme_service_factory.h" | 35 #include "chrome/browser/themes/theme_service_factory.h" |
| 35 #include "chrome/browser/themes/theme_syncable_service.h" | 36 #include "chrome/browser/themes/theme_syncable_service.h" |
| 36 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" | 37 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
| 37 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 38 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 38 #include "chrome/browser/web_data_service_factory.h" | 39 #include "chrome/browser/web_data_service_factory.h" |
| 39 #include "chrome/common/channel_info.h" | 40 #include "chrome/common/channel_info.h" |
| 40 #include "chrome/common/chrome_paths.h" | 41 #include "chrome/common/chrome_paths.h" |
| 41 #include "chrome/common/features.h" | 42 #include "chrome/common/features.h" |
| 42 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 61 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 61 #include "components/spellcheck/spellcheck_build_features.h" | 62 #include "components/spellcheck/spellcheck_build_features.h" |
| 62 #include "components/sync/base/pref_names.h" | 63 #include "components/sync/base/pref_names.h" |
| 63 #include "components/sync/base/report_unrecoverable_error.h" | 64 #include "components/sync/base/report_unrecoverable_error.h" |
| 64 #include "components/sync/driver/async_directory_type_controller.h" | 65 #include "components/sync/driver/async_directory_type_controller.h" |
| 65 #include "components/sync/driver/sync_api_component_factory.h" | 66 #include "components/sync/driver/sync_api_component_factory.h" |
| 66 #include "components/sync/driver/sync_util.h" | 67 #include "components/sync/driver/sync_util.h" |
| 67 #include "components/sync/engine/browser_thread_model_worker.h" | 68 #include "components/sync/engine/browser_thread_model_worker.h" |
| 68 #include "components/sync/engine/passive_model_worker.h" | 69 #include "components/sync/engine/passive_model_worker.h" |
| 69 #include "components/sync/engine/ui_model_worker.h" | 70 #include "components/sync/engine/ui_model_worker.h" |
| 71 #include "components/sync/user_events/user_event_service.h" |
| 70 #include "components/sync_preferences/pref_service_syncable.h" | 72 #include "components/sync_preferences/pref_service_syncable.h" |
| 71 #include "components/sync_sessions/favicon_cache.h" | 73 #include "components/sync_sessions/favicon_cache.h" |
| 72 #include "components/sync_sessions/sync_sessions_client.h" | 74 #include "components/sync_sessions/sync_sessions_client.h" |
| 73 #include "content/public/browser/browser_thread.h" | 75 #include "content/public/browser/browser_thread.h" |
| 74 #include "extensions/features/features.h" | 76 #include "extensions/features/features.h" |
| 75 #include "ui/base/device_form_factor.h" | 77 #include "ui/base/device_form_factor.h" |
| 76 | 78 |
| 77 #if BUILDFLAG(ENABLE_APP_LIST) | 79 #if BUILDFLAG(ENABLE_APP_LIST) |
| 78 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 80 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 79 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 81 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 case syncer::AUTOFILL: | 502 case syncer::AUTOFILL: |
| 501 return autofill::AutocompleteSyncBridge::FromWebDataService( | 503 return autofill::AutocompleteSyncBridge::FromWebDataService( |
| 502 web_data_service_.get()); | 504 web_data_service_.get()); |
| 503 #if defined(OS_CHROMEOS) | 505 #if defined(OS_CHROMEOS) |
| 504 case syncer::PRINTERS: | 506 case syncer::PRINTERS: |
| 505 return chromeos::PrintersManagerFactory::GetForBrowserContext(profile_) | 507 return chromeos::PrintersManagerFactory::GetForBrowserContext(profile_) |
| 506 ->GetSyncBridge() | 508 ->GetSyncBridge() |
| 507 ->AsWeakPtr(); | 509 ->AsWeakPtr(); |
| 508 #endif // defined(OS_CHROMEOS) | 510 #endif // defined(OS_CHROMEOS) |
| 509 case syncer::TYPED_URLS: | 511 case syncer::TYPED_URLS: |
| 510 // TODO(gangwu):implement TypedURLSyncBridge and return real | 512 // TODO(gangwu): Implement TypedURLSyncBridge and return real |
| 511 // TypedURLSyncBridge here. | 513 // TypedURLSyncBridge here. |
| 512 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 514 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 515 case syncer::USER_EVENTS: |
| 516 return browser_sync::UserEventServiceFactory::GetForProfile(profile_) |
| 517 ->GetSyncBridge() |
| 518 ->AsWeakPtr(); |
| 513 default: | 519 default: |
| 514 NOTREACHED(); | 520 NOTREACHED(); |
| 515 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 521 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 516 } | 522 } |
| 517 } | 523 } |
| 518 | 524 |
| 519 scoped_refptr<syncer::ModelSafeWorker> | 525 scoped_refptr<syncer::ModelSafeWorker> |
| 520 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { | 526 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { |
| 521 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 527 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 522 switch (group) { | 528 switch (group) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 sync_service->RegisterDataTypeController( | 712 sync_service->RegisterDataTypeController( |
| 707 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 713 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 708 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 714 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
| 709 sync_service->RegisterDataTypeController( | 715 sync_service->RegisterDataTypeController( |
| 710 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 716 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 711 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 717 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 712 #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) | 718 #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 713 } | 719 } |
| 714 | 720 |
| 715 } // namespace browser_sync | 721 } // namespace browser_sync |
| OLD | NEW |