| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { | 258 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { |
| 259 return base::Bind( | 259 return base::Bind( |
| 260 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, | 260 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, |
| 261 base::Unretained(profile_)); | 261 base::Unretained(profile_)); |
| 262 } | 262 } |
| 263 | 263 |
| 264 syncer::SyncApiComponentFactory::RegisterDataTypesMethod | 264 syncer::SyncApiComponentFactory::RegisterDataTypesMethod |
| 265 ChromeSyncClient::GetRegisterPlatformTypesCallback() { | 265 ChromeSyncClient::GetRegisterPlatformTypesCallback() { |
| 266 return base::Bind( | 266 return base::Bind( |
| 267 #if BUILDFLAG(ANDROID_JAVA_UI) | 267 #if defined(OS_ANDROID) |
| 268 &ChromeSyncClient::RegisterAndroidDataTypes, | 268 &ChromeSyncClient::RegisterAndroidDataTypes, |
| 269 #else | 269 #else |
| 270 &ChromeSyncClient::RegisterDesktopDataTypes, | 270 &ChromeSyncClient::RegisterDesktopDataTypes, |
| 271 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 271 #endif // defined(OS_ANDROID) |
| 272 weak_ptr_factory_.GetWeakPtr()); | 272 weak_ptr_factory_.GetWeakPtr()); |
| 273 } | 273 } |
| 274 | 274 |
| 275 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { | 275 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { |
| 276 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); | 276 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); |
| 277 } | 277 } |
| 278 | 278 |
| 279 invalidation::InvalidationService* ChromeSyncClient::GetInvalidationService() { | 279 invalidation::InvalidationService* ChromeSyncClient::GetInvalidationService() { |
| 280 invalidation::ProfileInvalidationProvider* provider = | 280 invalidation::ProfileInvalidationProvider* provider = |
| 281 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile_); | 281 invalidation::ProfileInvalidationProviderFactory::GetForProfile(profile_); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 sync_service->RegisterDataTypeController( | 640 sync_service->RegisterDataTypeController( |
| 641 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 641 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 642 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 642 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
| 643 sync_service->RegisterDataTypeController( | 643 sync_service->RegisterDataTypeController( |
| 644 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 644 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 645 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 645 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 646 #endif | 646 #endif |
| 647 } | 647 } |
| 648 | 648 |
| 649 } // namespace browser_sync | 649 } // namespace browser_sync |
| OLD | NEW |