Chromium Code Reviews| 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 "chrome/browser/autofill/personal_data_manager_factory.h" | 9 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 11 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 11 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 12 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 12 #include "chrome/browser/favicon/favicon_service_factory.h" | 13 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 13 #include "chrome/browser/history/history_service_factory.h" | 14 #include "chrome/browser/history/history_service_factory.h" |
| 14 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" | 15 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
| 15 #include "chrome/browser/password_manager/password_store_factory.h" | 16 #include "chrome/browser/password_manager/password_store_factory.h" |
| 16 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 17 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/search_engines/template_url_service_factory.h" | 19 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 20 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | |
| 19 #include "chrome/browser/sync/glue/sync_start_util.h" | 21 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 22 #include "chrome/browser/sync/glue/theme_data_type_controller.h" | |
| 20 #include "chrome/browser/sync/profile_sync_service_factory.h" | 23 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 21 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" | 24 #include "chrome/browser/sync/sessions/notification_service_sessions_router.h" |
| 22 #include "chrome/browser/themes/theme_service.h" | 25 #include "chrome/browser/themes/theme_service.h" |
| 23 #include "chrome/browser/themes/theme_service_factory.h" | 26 #include "chrome/browser/themes/theme_service_factory.h" |
| 24 #include "chrome/browser/themes/theme_syncable_service.h" | 27 #include "chrome/browser/themes/theme_syncable_service.h" |
| 25 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" | 28 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
| 26 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 29 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 27 #include "chrome/browser/web_data_service_factory.h" | 30 #include "chrome/browser/web_data_service_factory.h" |
| 31 #include "chrome/common/channel_info.h" | |
| 32 #include "chrome/common/pref_names.h" | |
| 28 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
| 29 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service .h" | 34 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service .h" |
| 30 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h" | 35 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h" |
| 31 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync able_service.h" | 36 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync able_service.h" |
| 32 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv ice.h" | 37 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv ice.h" |
| 33 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 38 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 39 #include "components/browser_sync/browser/profile_sync_components_factory_impl.h " | |
| 34 #include "components/browser_sync/browser/profile_sync_service.h" | 40 #include "components/browser_sync/browser/profile_sync_service.h" |
| 41 #include "components/browser_sync/common/browser_sync_switches.h" | |
| 35 #include "components/dom_distiller/core/dom_distiller_service.h" | 42 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 36 #include "components/history/core/browser/history_model_worker.h" | 43 #include "components/history/core/browser/history_model_worker.h" |
| 37 #include "components/history/core/browser/history_service.h" | 44 #include "components/history/core/browser/history_service.h" |
| 38 #include "components/invalidation/impl/profile_invalidation_provider.h" | 45 #include "components/invalidation/impl/profile_invalidation_provider.h" |
| 39 #include "components/password_manager/core/browser/password_store.h" | 46 #include "components/password_manager/core/browser/password_store.h" |
| 40 #include "components/password_manager/sync/browser/password_model_worker.h" | 47 #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" | |
| 41 #include "components/sync_driver/glue/browser_thread_model_worker.h" | 50 #include "components/sync_driver/glue/browser_thread_model_worker.h" |
| 51 #include "components/sync_driver/glue/chrome_report_unrecoverable_error.h" | |
| 42 #include "components/sync_driver/glue/ui_model_worker.h" | 52 #include "components/sync_driver/glue/ui_model_worker.h" |
| 43 #include "components/sync_driver/sync_api_component_factory.h" | 53 #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" | |
| 44 #include "components/sync_sessions/sync_sessions_client.h" | 56 #include "components/sync_sessions/sync_sessions_client.h" |
| 45 #include "components/syncable_prefs/pref_service_syncable.h" | 57 #include "components/syncable_prefs/pref_service_syncable.h" |
| 46 #include "content/public/browser/browser_thread.h" | 58 #include "content/public/browser/browser_thread.h" |
| 47 #include "sync/internal_api/public/engine/passive_model_worker.h" | 59 #include "sync/internal_api/public/engine/passive_model_worker.h" |
| 60 #include "ui/base/device_form_factor.h" | |
| 48 | 61 |
| 49 #if defined(ENABLE_APP_LIST) | 62 #if defined(ENABLE_APP_LIST) |
| 50 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 63 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 51 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 64 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 52 #include "ui/app_list/app_list_switches.h" | 65 #include "ui/app_list/app_list_switches.h" |
| 53 #endif | 66 #endif |
| 54 | 67 |
| 55 #if defined(ENABLE_EXTENSIONS) | 68 #if defined(ENABLE_EXTENSIONS) |
| 56 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" | 69 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" |
| 57 #include "chrome/browser/extensions/extension_sync_service.h" | 70 #include "chrome/browser/extensions/extension_sync_service.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 80 #if defined(OS_ANDROID) | 93 #if defined(OS_ANDROID) |
| 81 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" | 94 #include "chrome/browser/sync/glue/synced_window_delegates_getter_android.h" |
| 82 #endif | 95 #endif |
| 83 | 96 |
| 84 #if defined(OS_CHROMEOS) | 97 #if defined(OS_CHROMEOS) |
| 85 #include "components/wifi_sync/wifi_credential_syncable_service.h" | 98 #include "components/wifi_sync/wifi_credential_syncable_service.h" |
| 86 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" | 99 #include "components/wifi_sync/wifi_credential_syncable_service_factory.h" |
| 87 #endif | 100 #endif |
| 88 | 101 |
| 89 using content::BrowserThread; | 102 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; | |
| 90 | 109 |
| 91 namespace browser_sync { | 110 namespace browser_sync { |
| 92 | 111 |
| 93 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class | 112 // Chrome implementation of SyncSessionsClient. Needs to be in a separate class |
| 94 // due to possible multiple inheritance issues, wherein ChromeSyncClient might | 113 // due to possible multiple inheritance issues, wherein ChromeSyncClient might |
| 95 // inherit from other interfaces with same methods. | 114 // inherit from other interfaces with same methods. |
| 96 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { | 115 class SyncSessionsClientImpl : public sync_sessions::SyncSessionsClient { |
| 97 public: | 116 public: |
| 98 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { | 117 explicit SyncSessionsClientImpl(Profile* profile) : profile_(profile) { |
| 99 window_delegates_getter_.reset( | 118 window_delegates_getter_.reset( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 new NotificationServiceSessionsRouter(profile_, this, flare)); | 163 new NotificationServiceSessionsRouter(profile_, this, flare)); |
| 145 } | 164 } |
| 146 | 165 |
| 147 private: | 166 private: |
| 148 Profile* profile_; | 167 Profile* profile_; |
| 149 scoped_ptr<SyncedWindowDelegatesGetter> window_delegates_getter_; | 168 scoped_ptr<SyncedWindowDelegatesGetter> window_delegates_getter_; |
| 150 | 169 |
| 151 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl); | 170 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClientImpl); |
| 152 }; | 171 }; |
| 153 | 172 |
| 154 ChromeSyncClient::ChromeSyncClient( | 173 ChromeSyncClient::ChromeSyncClient(Profile* profile) |
| 155 Profile* profile, | |
| 156 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory) | |
| 157 : profile_(profile), | 174 : profile_(profile), |
| 158 component_factory_(component_factory.Pass()), | |
| 159 sync_sessions_client_(new SyncSessionsClientImpl(profile)), | 175 sync_sessions_client_(new SyncSessionsClientImpl(profile)), |
| 160 browsing_data_remover_observer_(NULL) {} | 176 browsing_data_remover_observer_(NULL), |
| 177 weak_ptr_factory_(this) {} | |
| 161 | 178 |
| 162 ChromeSyncClient::~ChromeSyncClient() { | 179 ChromeSyncClient::~ChromeSyncClient() { |
| 163 } | 180 } |
| 164 | 181 |
| 165 void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) { | 182 void ChromeSyncClient::Initialize(sync_driver::SyncService* sync_service) { |
| 166 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 183 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( | |
|
blundell
2015/11/16 08:43:10
The CL description says that the callback is being
| |
| 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 } | |
| 167 sync_service_ = sync_service; | 204 sync_service_ = sync_service; |
| 168 web_data_service_ = GetWebDataService(); | 205 web_data_service_ = GetWebDataService(); |
| 169 password_store_ = GetPasswordStore(); | 206 password_store_ = GetPasswordStore(); |
| 170 component_factory_->RegisterDataTypes(this); | |
| 171 } | 207 } |
| 172 | 208 |
| 173 sync_driver::SyncService* ChromeSyncClient::GetSyncService() { | 209 sync_driver::SyncService* ChromeSyncClient::GetSyncService() { |
| 174 // TODO(zea): bring back this DCHECK after Typed URLs are converted to | 210 // TODO(zea): bring back this DCHECK after Typed URLs are converted to |
| 175 // SyncableService. | 211 // SyncableService. |
| 176 // DCHECK_CURRENTLY_ON(BrowserThread::UI); | 212 // DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 177 return sync_service_; | 213 return sync_service_; |
| 178 } | 214 } |
| 179 | 215 |
| 180 PrefService* ChromeSyncClient::GetPrefService() { | 216 PrefService* ChromeSyncClient::GetPrefService() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 return base::Bind(&ChromeSyncClient::ClearBrowsingData, | 252 return base::Bind(&ChromeSyncClient::ClearBrowsingData, |
| 217 base::Unretained(this)); | 253 base::Unretained(this)); |
| 218 } | 254 } |
| 219 | 255 |
| 220 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { | 256 base::Closure ChromeSyncClient::GetPasswordStateChangedCallback() { |
| 221 return base::Bind( | 257 return base::Bind( |
| 222 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, | 258 &PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged, |
| 223 base::Unretained(profile_)); | 259 base::Unretained(profile_)); |
| 224 } | 260 } |
| 225 | 261 |
| 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 | |
| 226 scoped_refptr<autofill::AutofillWebDataService> | 273 scoped_refptr<autofill::AutofillWebDataService> |
| 227 ChromeSyncClient::GetWebDataService() { | 274 ChromeSyncClient::GetWebDataService() { |
| 228 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 275 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 229 return WebDataServiceFactory::GetAutofillWebDataForProfile( | 276 return WebDataServiceFactory::GetAutofillWebDataForProfile( |
| 230 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 277 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 231 } | 278 } |
| 232 | 279 |
| 233 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { | 280 BookmarkUndoService* ChromeSyncClient::GetBookmarkUndoServiceIfExists() { |
| 234 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); | 281 return BookmarkUndoServiceFactory::GetForProfileIfExists(profile_); |
| 235 } | 282 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 434 PasswordStoreFactory::GetForProfile(profile_, | 481 PasswordStoreFactory::GetForProfile(profile_, |
| 435 ServiceAccessType::EXPLICIT_ACCESS); | 482 ServiceAccessType::EXPLICIT_ACCESS); |
| 436 password->RemoveLoginsSyncedBetween(start, end); | 483 password->RemoveLoginsSyncedBetween(start, end); |
| 437 } | 484 } |
| 438 | 485 |
| 439 void ChromeSyncClient::SetBrowsingDataRemoverObserverForTesting( | 486 void ChromeSyncClient::SetBrowsingDataRemoverObserverForTesting( |
| 440 BrowsingDataRemover::Observer* observer) { | 487 BrowsingDataRemover::Observer* observer) { |
| 441 browsing_data_remover_observer_ = observer; | 488 browsing_data_remover_observer_ = observer; |
| 442 } | 489 } |
| 443 | 490 |
| 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 | |
| 444 } // namespace browser_sync | 619 } // namespace browser_sync |
| OLD | NEW |