| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor
y.h" | 83 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor
y.h" |
| 84 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll
er.h" | 84 #include "chrome/browser/supervised_user/supervised_user_sync_data_type_controll
er.h" |
| 85 #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h" | 85 #include "chrome/browser/supervised_user/supervised_user_whitelist_service.h" |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 #if defined(ENABLE_SPELLCHECK) | 88 #if defined(ENABLE_SPELLCHECK) |
| 89 #include "chrome/browser/spellchecker/spellcheck_factory.h" | 89 #include "chrome/browser/spellchecker/spellcheck_factory.h" |
| 90 #include "chrome/browser/spellchecker/spellcheck_service.h" | 90 #include "chrome/browser/spellchecker/spellcheck_service.h" |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 #if defined(OS_ANDROID) | 93 #if defined(ANDROID_JAVA_UI) |
| 94 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" | 94 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" |
| 95 #endif | 95 #endif |
| 96 | 96 |
| 97 #if defined(OS_CHROMEOS) | 97 #if defined(OS_CHROMEOS) |
| 98 #include "components/wifi_sync/wifi_credential_syncable_service.h" | 98 #include "components/wifi_sync/wifi_credential_syncable_service.h" |
| 99 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" | 99 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 using content::BrowserThread; | 102 using content::BrowserThread; |
| 103 #if defined(ENABLE_EXTENSIONS) | 103 #if defined(ENABLE_EXTENSIONS) |
| 104 using browser_sync::ExtensionDataTypeController; | 104 using browser_sync::ExtensionDataTypeController; |
| 105 using browser_sync::ExtensionSettingDataTypeController; | 105 using browser_sync::ExtensionSettingDataTypeController; |
| 106 #endif | 106 #endif |
| 107 using browser_sync::SearchEngineDataTypeController; | 107 using browser_sync::SearchEngineDataTypeController; |
| 108 using sync_driver::UIDataTypeController; | 108 using sync_driver::UIDataTypeController; |
| 109 | 109 |
| 110 namespace browser_sync { | 110 namespace browser_sync { |
| 111 | 111 |
| 112 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class | 112 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class |
| 113 // due to possible multiple inheritance issues, wherein ChromeSyncClient might | 113 // due to possible multiple inheritance issues, wherein ChromeSyncClient might |
| 114 // inherit from other interfaces with same methods. | 114 // inherit from other interfaces with same methods. |
| 115 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { | 115 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { |
| 116 public: | 116 public: |
| 117 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { | 117 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { |
| 118 window_delegates_getter_.reset( | 118 window_delegates_getter_.reset( |
| 119 #if defined(OS_ANDROID) | 119 #if defined(ANDROID_JAVA_UI) |
| 120 // Android doesn't have multi-profile support, so no need to pass the | 120 // Android doesn't have multi-profile support, so no need to pass the |
| 121 // profile in. | 121 // profile in. |
| 122 new browser_sync::SyncedWindowDelegatesGetterAndroid()); | 122 new browser_sync::SyncedWindowDelegatesGetterAndroid()); |
| 123 #else | 123 #else |
| 124 new browser_sync::BrowserSyncedWindowDelegatesGetter(profile)); | 124 new browser_sync::BrowserSyncedWindowDelegatesGetter(profile)); |
| 125 #endif | 125 #endif |
| 126 } | 126 } |
| 127 ~SyncSessionsClientImpl() override {} | 127 ~SyncSessionsClientImpl() override {} |
| 128 | 128 |
| 129 // SyncSessionsClient implementation. | 129 // SyncSessionsClient implementation. |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { | 256 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { |
| 257 return base::Bind( | 257 return base::Bind( |
| 258 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, | 258 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, |
| 259 base::Unretained(profile_)); | 259 base::Unretained(profile_)); |
| 260 } | 260 } |
| 261 | 261 |
| 262 sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod | 262 sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod |
| 263 ChromeSyncClient::GetRegisterPlatformTypesCallback() { | 263 ChromeSyncClient::GetRegisterPlatformTypesCallback() { |
| 264 return base::Bind( | 264 return base::Bind( |
| 265 #ifdef OS_ANDROID | 265 #ifdef ANDROID_JAVA_UI |
| 266 &ChromeSyncClient::RegisterAndroidDataTypes, | 266 &ChromeSyncClient::RegisterAndroidDataTypes, |
| 267 #else | 267 #else |
| 268 &ChromeSyncClient::RegisterDesktopDataTypes, | 268 &ChromeSyncClient::RegisterDesktopDataTypes, |
| 269 #endif // OS_ANDROID | 269 #endif // ANDROID_JAVA_UI |
| 270 weak_ptr_factory_.GetWeakPtr()); | 270 weak_ptr_factory_.GetWeakPtr()); |
| 271 } | 271 } |
| 272 | 272 |
| 273 scoped_refptr<autofill::AutofillWebDataService> | 273 scoped_refptr<autofill::AutofillWebDataService> |
| 274 ChromeSyncClient::GetWebDataService() { | 274 ChromeSyncClient::GetWebDataService() { |
| 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 276 return WebDataServiceFactory::GetAutofillWebDataForProfile( | 276 return WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 277 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 277 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 278 } | 278 } |
| 279 | 279 |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 sync_service->RegisterDataTypeController( | 610 sync_service->RegisterDataTypeController( |
| 611 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, | 611 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, |
| 612 error_callback, this, profile_)); | 612 error_callback, this, profile_)); |
| 613 sync_service->RegisterDataTypeController( | 613 sync_service->RegisterDataTypeController( |
| 614 new SupervisedUserSyncDataTypeController( | 614 new SupervisedUserSyncDataTypeController( |
| 615 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 615 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 616 #endif | 616 #endif |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace browser_sync | 619 } // namespace browser_sync |
| OLD | NEW |