| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor
y.h" | 93 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor
y.h" |
| 94 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll
er.h" | 94 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll
er.h" |
| 95 #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h" | 95 #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h" |
| 96 #endif | 96 #endif |
| 97 | 97 |
| 98 #if BUILDFLAG(ENABLE_SPELLCHECK) | 98 #if BUILDFLAG(ENABLE_SPELLCHECK) |
| 99 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 99 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
| 100 #include "chrome/browser/spellchecker/spellcheck_service.h" | 100 #include "chrome/browser/spellchecker/spellcheck_service.h" |
| 101 #endif | 101 #endif |
| 102 | 102 |
| 103 #if BUILDFLAG(ANDROID_JAVA_UI) | 103 #if defined(OS_ANDROID) |
| 104 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" | 104 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" |
| 105 #endif | 105 #endif |
| 106 | 106 |
| 107 #if defined(OS_CHROMEOS) | 107 #if defined(OS_CHROMEOS) |
| 108 #include "chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h
" | 108 #include "chrome/browser/ui/app_list/arc/arc_package_sync_data_type_controller.h
" |
| 109 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" | 109 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" |
| 110 #include "components/sync_wifi/wifi_credential_syncable_service.h" | 110 #include "components/sync_wifi/wifi_credential_syncable_service.h" |
| 111 #include "components/sync_wifi/wifi_credential_syncable_service_factory.h" | 111 #include "components/sync_wifi/wifi_credential_syncable_service_factory.h" |
| 112 #endif | 112 #endif |
| 113 | 113 |
| 114 using content::BrowserThread; | 114 using content::BrowserThread; |
| 115 #if BUILDFLAG(ENABLE_EXTENSIONS) | 115 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 116 using browser_sync::ExtensionDataTypeController; | 116 using browser_sync::ExtensionDataTypeController; |
| 117 using browser_sync::ExtensionSettingDataTypeController; | 117 using browser_sync::ExtensionSettingDataTypeController; |
| 118 #endif | 118 #endif |
| 119 using browser_sync::SearchEngineDataTypeController; | 119 using browser_sync::SearchEngineDataTypeController; |
| 120 using syncer::AsyncDirectoryTypeController; | 120 using syncer::AsyncDirectoryTypeController; |
| 121 | 121 |
| 122 namespace browser_sync { | 122 namespace browser_sync { |
| 123 | 123 |
| 124 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class | 124 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class |
| 125 // due to possible multiple inheritance issues, wherein ChromeSyncClient might | 125 // due to possible multiple inheritance issues, wherein ChromeSyncClient might |
| 126 // inherit from other interfaces with same methods. | 126 // inherit from other interfaces with same methods. |
| 127 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { | 127 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { |
| 128 public: | 128 public: |
| 129 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { | 129 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { |
| 130 window_delegates_getter_.reset( | 130 window_delegates_getter_.reset( |
| 131 #if BUILDFLAG(ANDROID_JAVA_UI) | 131 #if defined(OS_ANDROID) |
| 132 // Android doesn't have multi-profile support, so no need to pass the | 132 // Android doesn't have multi-profile support, so no need to pass the |
| 133 // profile in. | 133 // profile in. |
| 134 new SyncedWindowDelegatesGetterAndroid()); | 134 new SyncedWindowDelegatesGetterAndroid()); |
| 135 #else | 135 #else |
| 136 new browser_sync::BrowserSyncedWindowDelegatesGetter(profile)); | 136 new browser_sync::BrowserSyncedWindowDelegatesGetter(profile)); |
| 137 #endif | 137 #endif |
| 138 } | 138 } |
| 139 ~SyncSessionsClientImpl() override {} | 139 ~SyncSessionsClientImpl() override {} |
| 140 | 140 |
| 141 // SyncSessionsClient implementation. | 141 // SyncSessionsClient implementation. |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { | 262 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { |
| 263 return base::Bind( | 263 return base::Bind( |
| 264 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, | 264 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, |
| 265 base::Unretained(profile_)); | 265 base::Unretained(profile_)); |
| 266 } | 266 } |
| 267 | 267 |
| 268 syncer::SyncApiComponentFactory::RegisterDataTypesMethod | 268 syncer::SyncApiComponentFactory::RegisterDataTypesMethod |
| 269 ChromeSyncClient::GetRegisterPlatformTypesCallback() { | 269 ChromeSyncClient::GetRegisterPlatformTypesCallback() { |
| 270 return base::Bind( | 270 return base::Bind( |
| 271 #if BUILDFLAG(ANDROID_JAVA_UI) | 271 #if defined(OS_ANDROID) |
| 272 &ChromeSyncClient::RegisterAndroidDataTypes, | 272 &ChromeSyncClient::RegisterAndroidDataTypes, |
| 273 #else | 273 #else |
| 274 &ChromeSyncClient::RegisterDesktopDataTypes, | 274 &ChromeSyncClient::RegisterDesktopDataTypes, |
| 275 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 275 #endif // defined(OS_ANDROID) |
| 276 weak_ptr_factory_.GetWeakPtr()); | 276 weak_ptr_factory_.GetWeakPtr()); |
| 277 } | 277 } |
| 278 | 278 |
| 279 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { | 279 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { |
| 280 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); | 280 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); |
| 281 } | 281 } |
| 282 | 282 |
| 283 invalidation::InvalidationService* ChromeSyncClient::GetInvalidationService() { | 283 invalidation::InvalidationService* ChromeSyncClient::GetInvalidationService() { |
| 284 invalidation::ProfileInvalidationProvider* provider = | 284 invalidation::ProfileInvalidationProvider* provider = |
| 285 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile_); | 285 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile_); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 sync_service->RegisterDataTypeController( | 644 sync_service->RegisterDataTypeController( |
| 645 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 645 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 646 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 646 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
| 647 sync_service->RegisterDataTypeController( | 647 sync_service->RegisterDataTypeController( |
| 648 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 648 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 649 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 649 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 650 #endif | 650 #endif |
| 651 } | 651 } |
| 652 | 652 |
| 653 } // namespace browser_sync | 653 } // namespace browser_sync |
| OLD | NEW |