| 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" | |
| 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 8 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 11 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 12 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 11 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 13 #include "chrome/browser/favicon/favicon_service_factory.h" | 12 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 14 #include "chrome/browser/history/history_service_factory.h" | 13 #include "chrome/browser/history/history_service_factory.h" |
| 15 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" | 14 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
| 16 #include "chrome/browser/password_manager/password_store_factory.h" | 15 #include "chrome/browser/password_manager/password_store_factory.h" |
| 17 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 16 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/browser/search_engines/template_url_service_factory.h" | 18 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 20 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | |
| 21 #include "chrome/browser/sync/glue/sync_start_util.h" | 19 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 22 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | |
| 23 #include "chrome/browser/sync/profile_sync_service_factory.h" | 20 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 24 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" | 21 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" |
| 25 #include "chrome/browser/themes/theme_service.h" | 22 #include "chrome/browser/themes/theme_service.h" |
| 26 #include "chrome/browser/themes/theme_service_factory.h" | 23 #include "chrome/browser/themes/theme_service_factory.h" |
| 27 #include "chrome/browser/themes/theme_syncable_service.h" | 24 #include "chrome/browser/themes/theme_syncable_service.h" |
| 28 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" | 25 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
| 29 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 26 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 30 #include "chrome/browser/web_data_service_factory.h" | 27 #include "chrome/browser/web_data_service_factory.h" |
| 31 #include "chrome/common/channel_info.h" | |
| 32 #include "chrome/common/pref_names.h" | |
| 33 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
| 34 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" | 29 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" |
| 35 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" | 30 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" |
| 36 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" | 31 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" |
| 37 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" | 32 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" |
| 38 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 33 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 39 #include "components/browser_sync/browser/profile_sync_components_factory_impl.h
" | |
| 40 #include "components/browser_sync/browser/profile_sync_service.h" | 34 #include "components/browser_sync/browser/profile_sync_service.h" |
| 41 #include "components/browser_sync/common/browser_sync_switches.h" | |
| 42 #include "components/dom_distiller/core/dom_distiller_service.h" | 35 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 43 #include "components/history/core/browser/history_model_worker.h" | 36 #include "components/history/core/browser/history_model_worker.h" |
| 44 #include "components/history/core/browser/history_service.h" | 37 #include "components/history/core/browser/history_service.h" |
| 45 #include "components/invalidation/impl/profile_invalidation_provider.h" | 38 #include "components/invalidation/impl/profile_invalidation_provider.h" |
| 46 #include "components/password_manager/core/browser/password_store.h" | 39 #include "components/password_manager/core/browser/password_store.h" |
| 47 #include "components/password_manager/sync/browser/password_model_worker.h" | 40 #include "components/password_manager/sync/browser/password_model_worker.h" |
| 48 #include "components/search_engines/search_engine_data_type_controller.h" | |
| 49 #include "components/signin/core/browser/profile_oauth2_token_service.h" | |
| 50 #include "components/sync_driver/glue/browser_thread_model_worker.h" | 41 #include "components/sync_driver/glue/browser_thread_model_worker.h" |
| 51 #include "components/sync_driver/glue/chrome_report_unrecoverable_error.h" | |
| 52 #include "components/sync_driver/glue/ui_model_worker.h" | 42 #include "components/sync_driver/glue/ui_model_worker.h" |
| 53 #include "components/sync_driver/sync_api_component_factory.h" | 43 #include "components/sync_driver/sync_api_component_factory.h" |
| 54 #include "components/sync_driver/sync_util.h" | |
| 55 #include "components/sync_driver/ui_data_type_controller.h" | |
| 56 #include "components/sync_sessions/sync_sessions_client.h" | 44 #include "components/sync_sessions/sync_sessions_client.h" |
| 57 #include "components/syncable_prefs/pref_service_syncable.h" | 45 #include "components/syncable_prefs/pref_service_syncable.h" |
| 58 #include "content/public/browser/browser_thread.h" | 46 #include "content/public/browser/browser_thread.h" |
| 59 #include "sync/internal_api/public/engine/passive_model_worker.h" | 47 #include "sync/internal_api/public/engine/passive_model_worker.h" |
| 60 #include "ui/base/device_form_factor.h" | |
| 61 | 48 |
| 62 #if defined(ENABLE_APP_LIST) | 49 #if defined(ENABLE_APP_LIST) |
| 63 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 50 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 64 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 51 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 65 #include "ui/app_list/app_list_switches.h" | 52 #include "ui/app_list/app_list_switches.h" |
| 66 #endif | 53 #endif |
| 67 | 54 |
| 68 #if defined(ENABLE_EXTENSIONS) | 55 #if defined(ENABLE_EXTENSIONS) |
| 69 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" | 56 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" |
| 70 #include "chrome/browser/extensions/extension_sync_service.h" | 57 #include "chrome/browser/extensions/extension_sync_service.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 93 #if defined(OS_ANDROID) | 80 #if defined(OS_ANDROID) |
| 94 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" | 81 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" |
| 95 #endif | 82 #endif |
| 96 | 83 |
| 97 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| 98 #include "components/wifi_sync/wifi_credential_syncable_service.h" | 85 #include "components/wifi_sync/wifi_credential_syncable_service.h" |
| 99 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" | 86 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" |
| 100 #endif | 87 #endif |
| 101 | 88 |
| 102 using content::BrowserThread; | 89 using content::BrowserThread; |
| 103 #if defined(ENABLE_EXTENSIONS) | |
| 104 using browser_sync::ExtensionDataTypeController; | |
| 105 using browser_sync::ExtensionSettingDataTypeController; | |
| 106 #endif | |
| 107 using browser_sync::SearchEngineDataTypeController; | |
| 108 using sync_driver::UIDataTypeController; | |
| 109 | 90 |
| 110 namespace browser_sync { | 91 namespace browser_sync { |
| 111 | 92 |
| 112 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class | 93 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class |
| 113 // due to possible multiple inheritance issues, wherein ChromeSyncClient might | 94 // due to possible multiple inheritance issues, wherein ChromeSyncClient might |
| 114 // inherit from other interfaces with same methods. | 95 // inherit from other interfaces with same methods. |
| 115 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { | 96 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { |
| 116 public: | 97 public: |
| 117 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { | 98 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { |
| 118 window_delegates_getter_.reset( | 99 window_delegates_getter_.reset( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 new NotificationServiceSessionsRouter(profile_, this, flare)); | 144 new NotificationServiceSessionsRouter(profile_, this, flare)); |
| 164 } | 145 } |
| 165 | 146 |
| 166 private: | 147 private: |
| 167 Profile* profile_; | 148 Profile* profile_; |
| 168 scoped_ptr<SyncedWindowDelegatesGetter> window_delegates_getter_; | 149 scoped_ptr<SyncedWindowDelegatesGetter> window_delegates_getter_; |
| 169 | 150 |
| 170 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl); | 151 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl); |
| 171 }; | 152 }; |
| 172 | 153 |
| 173 ChromeSyncClient::ChromeSyncClient(Profile* profile) | 154 ChromeSyncClient::ChromeSyncClient( |
| 155 Profile* profile, |
| 156 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory) |
| 174 : profile_(profile), | 157 : profile_(profile), |
| 158 component_factory_(component_factory.Pass()), |
| 175 sync_sessions_client_(new SyncSessionsClientImpl(profile)), | 159 sync_sessions_client_(new SyncSessionsClientImpl(profile)), |
| 176 browsing_data_remover_observer_(NULL), | 160 browsing_data_remover_observer_(NULL) {} |
| 177 weak_ptr_factory_(this) {} | |
| 178 | 161 |
| 179 ChromeSyncClient::~ChromeSyncClient() { | 162 ChromeSyncClient::~ChromeSyncClient() { |
| 180 } | 163 } |
| 181 | 164 |
| 182 void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) { | 165 void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) { |
| 183 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 166 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 184 // Component factory may already be set in tests. | |
| 185 if (!GetSyncApiComponentFactory()) { | |
| 186 const GURL sync_service_url = GetSyncServiceURL( | |
| 187 *base::CommandLine::ForCurrentProcess(), chrome::GetChannel()); | |
| 188 ProfileOAuth2TokenService* token_service = | |
| 189 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | |
| 190 net::URLRequestContextGetter* url_request_context_getter = | |
| 191 profile_->GetRequestContext(); | |
| 192 | |
| 193 component_factory_.reset(new ProfileSyncComponentsFactoryImpl( | |
| 194 this, chrome::GetChannel(), chrome::GetVersionString(), | |
| 195 ui::GetDeviceFormFactor() == ui::DEVICE_FORM_FACTOR_TABLET, | |
| 196 *base::CommandLine::ForCurrentProcess(), | |
| 197 prefs::kSavingBrowserHistoryDisabled, sync_service_url, | |
| 198 content::BrowserThread::GetMessageLoopProxyForThread( | |
| 199 content::BrowserThread::UI), | |
| 200 content::BrowserThread::GetMessageLoopProxyForThread( | |
| 201 content::BrowserThread::DB), | |
| 202 token_service, url_request_context_getter)); | |
| 203 } | |
| 204 sync_service_ = sync_service; | 167 sync_service_ = sync_service; |
| 205 web_data_service_ = GetWebDataService(); | 168 web_data_service_ = GetWebDataService(); |
| 206 password_store_ = GetPasswordStore(); | 169 password_store_ = GetPasswordStore(); |
| 170 component_factory_->RegisterDataTypes(this); |
| 207 } | 171 } |
| 208 | 172 |
| 209 sync_driver::SyncService* ChromeSyncClient::GetSyncService() { | 173 sync_driver::SyncService* ChromeSyncClient::GetSyncService() { |
| 210 // TODO(zea): bring back this DCHECK after Typed URLs are converted to | 174 // TODO(zea): bring back this DCHECK after Typed URLs are converted to |
| 211 // SyncableService. | 175 // SyncableService. |
| 212 // DCHECK_CURRENTLY_ON(BrowserThread::UI); | 176 // DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 213 return sync_service_; | 177 return sync_service_; |
| 214 } | 178 } |
| 215 | 179 |
| 216 PrefService* ChromeSyncClient::GetPrefService() { | 180 PrefService* ChromeSyncClient::GetPrefService() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 return base::Bind(&ChromeSyncClient::ClearBrowsingData, | 216 return base::Bind(&ChromeSyncClient::ClearBrowsingData, |
| 253 base::Unretained(this)); | 217 base::Unretained(this)); |
| 254 } | 218 } |
| 255 | 219 |
| 256 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { | 220 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { |
| 257 return base::Bind( | 221 return base::Bind( |
| 258 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, | 222 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, |
| 259 base::Unretained(profile_)); | 223 base::Unretained(profile_)); |
| 260 } | 224 } |
| 261 | 225 |
| 262 sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod | |
| 263 ChromeSyncClient::GetRegisterPlatformTypesCallback() { | |
| 264 return base::Bind( | |
| 265 #ifdef OS_ANDROID | |
| 266 &ChromeSyncClient::RegisterAndroidDataTypes, | |
| 267 #else | |
| 268 &ChromeSyncClient::RegisterDesktopDataTypes, | |
| 269 #endif // OS_ANDROID | |
| 270 weak_ptr_factory_.GetWeakPtr()); | |
| 271 } | |
| 272 | |
| 273 scoped_refptr<autofill::AutofillWebDataService> | 226 scoped_refptr<autofill::AutofillWebDataService> |
| 274 ChromeSyncClient::GetWebDataService() { | 227 ChromeSyncClient::GetWebDataService() { |
| 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 228 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 276 return WebDataServiceFactory::GetAutofillWebDataForProfile( | 229 return WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 277 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 230 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 278 } | 231 } |
| 279 | 232 |
| 280 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { | 233 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { |
| 281 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); | 234 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); |
| 282 } | 235 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 PasswordStoreFactory::GetForProfile(profile_, | 434 PasswordStoreFactory::GetForProfile(profile_, |
| 482 ServiceAccessType::EXPLICIT_ACCESS); | 435 ServiceAccessType::EXPLICIT_ACCESS); |
| 483 password->RemoveLoginsSyncedBetween(start, end); | 436 password->RemoveLoginsSyncedBetween(start, end); |
| 484 } | 437 } |
| 485 | 438 |
| 486 void ChromeSyncClient::SetBrowsingDataRemoverObserverForTesting( | 439 void ChromeSyncClient::SetBrowsingDataRemoverObserverForTesting( |
| 487 BrowsingDataRemover::Observer* observer) { | 440 BrowsingDataRemover::Observer* observer) { |
| 488 browsing_data_remover_observer_ = observer; | 441 browsing_data_remover_observer_ = observer; |
| 489 } | 442 } |
| 490 | 443 |
| 491 void ChromeSyncClient::SetSyncApiComponentFactoryForTesting( | |
| 492 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory) { | |
| 493 component_factory_ = component_factory.Pass(); | |
| 494 } | |
| 495 | |
| 496 void ChromeSyncClient::RegisterDesktopDataTypes( | |
| 497 syncer::ModelTypeSet disabled_types, | |
| 498 syncer::ModelTypeSet enabled_types) { | |
| 499 sync_driver::SyncService* sync_service = GetSyncService(); | |
| 500 base::Closure error_callback = | |
| 501 base::Bind(&ChromeReportUnrecoverableError, chrome::GetChannel()); | |
| 502 const scoped_refptr<base::SingleThreadTaskRunner> ui_thread = | |
| 503 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); | |
| 504 | |
| 505 #if defined(ENABLE_EXTENSIONS) | |
| 506 // App sync is enabled by default. Register unless explicitly | |
| 507 // disabled. | |
| 508 if (!disabled_types.Has(syncer::APPS)) { | |
| 509 sync_service->RegisterDataTypeController(new ExtensionDataTypeController( | |
| 510 syncer::APPS, error_callback, this, profile_)); | |
| 511 } | |
| 512 | |
| 513 // Extension sync is enabled by default. Register unless explicitly | |
| 514 // disabled. | |
| 515 if (!disabled_types.Has(syncer::EXTENSIONS)) { | |
| 516 sync_service->RegisterDataTypeController(new ExtensionDataTypeController( | |
| 517 syncer::EXTENSIONS, error_callback, this, profile_)); | |
| 518 } | |
| 519 #endif | |
| 520 | |
| 521 // Preference sync is enabled by default. Register unless explicitly | |
| 522 // disabled. | |
| 523 if (!disabled_types.Has(syncer::PREFERENCES)) { | |
| 524 sync_service->RegisterDataTypeController(new UIDataTypeController( | |
| 525 ui_thread, error_callback, syncer::PREFERENCES, this)); | |
| 526 } | |
| 527 | |
| 528 #if defined(ENABLE_THEMES) | |
| 529 // Theme sync is enabled by default. Register unless explicitly disabled. | |
| 530 if (!disabled_types.Has(syncer::THEMES)) { | |
| 531 sync_service->RegisterDataTypeController( | |
| 532 new ThemeDataTypeController(error_callback, this, profile_)); | |
| 533 } | |
| 534 #endif | |
| 535 | |
| 536 // Search Engine sync is enabled by default. Register unless explicitly | |
| 537 // disabled. | |
| 538 if (!disabled_types.Has(syncer::SEARCH_ENGINES)) { | |
| 539 sync_service->RegisterDataTypeController(new SearchEngineDataTypeController( | |
| 540 ui_thread, error_callback, this, | |
| 541 TemplateURLServiceFactory::GetForProfile(profile_))); | |
| 542 } | |
| 543 | |
| 544 #if defined(ENABLE_EXTENSIONS) | |
| 545 // Extension setting sync is enabled by default. Register unless explicitly | |
| 546 // disabled. | |
| 547 if (!disabled_types.Has(syncer::EXTENSION_SETTINGS)) { | |
| 548 sync_service->RegisterDataTypeController( | |
| 549 new ExtensionSettingDataTypeController(syncer::EXTENSION_SETTINGS, | |
| 550 error_callback, this, profile_)); | |
| 551 } | |
| 552 | |
| 553 // App setting sync is enabled by default. Register unless explicitly | |
| 554 // disabled. | |
| 555 if (!disabled_types.Has(syncer::APP_SETTINGS)) { | |
| 556 sync_service->RegisterDataTypeController( | |
| 557 new ExtensionSettingDataTypeController(syncer::APP_SETTINGS, | |
| 558 error_callback, this, profile_)); | |
| 559 } | |
| 560 #endif | |
| 561 | |
| 562 #if defined(ENABLE_APP_LIST) | |
| 563 if (app_list::switches::IsAppListSyncEnabled()) { | |
| 564 sync_service->RegisterDataTypeController(new UIDataTypeController( | |
| 565 ui_thread, error_callback, syncer::APP_LIST, this)); | |
| 566 } | |
| 567 #endif | |
| 568 | |
| 569 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS) | |
| 570 // Dictionary sync is enabled by default. | |
| 571 if (!disabled_types.Has(syncer::DICTIONARY)) { | |
| 572 sync_service->RegisterDataTypeController(new UIDataTypeController( | |
| 573 ui_thread, error_callback, syncer::DICTIONARY, this)); | |
| 574 } | |
| 575 #endif | |
| 576 | |
| 577 #if defined(ENABLE_SUPERVISED_USERS) | |
| 578 sync_service->RegisterDataTypeController( | |
| 579 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, | |
| 580 error_callback, this, profile_)); | |
| 581 sync_service->RegisterDataTypeController( | |
| 582 new SupervisedUserSyncDataTypeController( | |
| 583 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | |
| 584 sync_service->RegisterDataTypeController( | |
| 585 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USERS, | |
| 586 error_callback, this, profile_)); | |
| 587 sync_service->RegisterDataTypeController( | |
| 588 new SupervisedUserSyncDataTypeController( | |
| 589 syncer::SUPERVISED_USER_SHARED_SETTINGS, error_callback, this, | |
| 590 profile_)); | |
| 591 #endif | |
| 592 | |
| 593 #if defined(OS_CHROMEOS) | |
| 594 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 595 switches::kEnableWifiCredentialSync) && | |
| 596 !disabled_types.Has(syncer::WIFI_CREDENTIALS)) { | |
| 597 sync_service->RegisterDataTypeController(new UIDataTypeController( | |
| 598 ui_thread, error_callback, syncer::WIFI_CREDENTIALS, this)); | |
| 599 } | |
| 600 #endif | |
| 601 } | |
| 602 | |
| 603 void ChromeSyncClient::RegisterAndroidDataTypes( | |
| 604 syncer::ModelTypeSet disabled_types, | |
| 605 syncer::ModelTypeSet enabled_types) { | |
| 606 sync_driver::SyncService* sync_service = GetSyncService(); | |
| 607 base::Closure error_callback = | |
| 608 base::Bind(&ChromeReportUnrecoverableError, chrome::GetChannel()); | |
| 609 #if defined(ENABLE_SUPERVISED_USERS) | |
| 610 sync_service->RegisterDataTypeController( | |
| 611 new SupervisedUserSyncDataTypeController(syncer::SUPERVISED_USER_SETTINGS, | |
| 612 error_callback, this, profile_)); | |
| 613 sync_service->RegisterDataTypeController( | |
| 614 new SupervisedUserSyncDataTypeController( | |
| 615 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | |
| 616 #endif | |
| 617 } | |
| 618 | |
| 619 } // namespace browser_sync | 444 } // namespace browser_sync |
| OLD | NEW |