| 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 20 matching lines...) Expand all Loading... |
| 31 #include "chrome/browser/themes/theme_service.h" | 31 #include "chrome/browser/themes/theme_service.h" |
| 32 #include "chrome/browser/themes/theme_service_factory.h" | 32 #include "chrome/browser/themes/theme_service_factory.h" |
| 33 #include "chrome/browser/themes/theme_syncable_service.h" | 33 #include "chrome/browser/themes/theme_syncable_service.h" |
| 34 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" | 34 #include "chrome/browser/ui/sync/browser_synced_window_delegates_getter.h" |
| 35 #include "chrome/browser/undo/bookmark_undo_service_factory.h" | 35 #include "chrome/browser/undo/bookmark_undo_service_factory.h" |
| 36 #include "chrome/browser/web_data_service_factory.h" | 36 #include "chrome/browser/web_data_service_factory.h" |
| 37 #include "chrome/common/channel_info.h" | 37 #include "chrome/common/channel_info.h" |
| 38 #include "chrome/common/features.h" | 38 #include "chrome/common/features.h" |
| 39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
| 40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
| 41 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h" |
| 41 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" | 42 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" |
| 42 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" | 43 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" |
| 43 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" | 44 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" |
| 44 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" | 45 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" |
| 45 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 46 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 46 #include "components/browser_sync/browser_sync_switches.h" | 47 #include "components/browser_sync/browser_sync_switches.h" |
| 47 #include "components/browser_sync/profile_sync_components_factory_impl.h" | 48 #include "components/browser_sync/profile_sync_components_factory_impl.h" |
| 48 #include "components/browser_sync/profile_sync_service.h" | 49 #include "components/browser_sync/profile_sync_service.h" |
| 49 #include "components/dom_distiller/core/dom_distiller_service.h" | 50 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 50 #include "components/history/core/browser/history_model_worker.h" | 51 #include "components/history/core/browser/history_model_worker.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 ChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) { | 434 ChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) { |
| 434 switch (type) { | 435 switch (type) { |
| 435 case syncer::DEVICE_INFO: | 436 case syncer::DEVICE_INFO: |
| 436 return ProfileSyncServiceFactory::GetForProfile(profile_) | 437 return ProfileSyncServiceFactory::GetForProfile(profile_) |
| 437 ->GetDeviceInfoSyncBridge() | 438 ->GetDeviceInfoSyncBridge() |
| 438 ->AsWeakPtr(); | 439 ->AsWeakPtr(); |
| 439 case syncer::READING_LIST: | 440 case syncer::READING_LIST: |
| 440 // Reading List is only supported on iOS at the moment. | 441 // Reading List is only supported on iOS at the moment. |
| 441 NOTREACHED(); | 442 NOTREACHED(); |
| 442 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 443 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 444 case syncer::AUTOFILL: |
| 445 return autofill::AutocompleteSyncBridge::FromWebDataService( |
| 446 web_data_service_.get()) |
| 447 ->AsWeakPtr(); |
| 443 default: | 448 default: |
| 444 NOTREACHED(); | 449 NOTREACHED(); |
| 445 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 450 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 446 } | 451 } |
| 447 } | 452 } |
| 448 | 453 |
| 449 scoped_refptr<syncer::ModelSafeWorker> | 454 scoped_refptr<syncer::ModelSafeWorker> |
| 450 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { | 455 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { |
| 451 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 456 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 452 switch (group) { | 457 switch (group) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 sync_service->RegisterDataTypeController( | 637 sync_service->RegisterDataTypeController( |
| 633 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 638 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 634 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 639 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
| 635 sync_service->RegisterDataTypeController( | 640 sync_service->RegisterDataTypeController( |
| 636 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 641 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 637 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 642 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 638 #endif | 643 #endif |
| 639 } | 644 } |
| 640 | 645 |
| 641 } // namespace browser_sync | 646 } // namespace browser_sync |
| OLD | NEW |