| 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 "ios/chrome/browser/sync/ios_chrome_sync_client.h" | 5 #include "ios/chrome/browser/sync/ios_chrome_sync_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "components/autofill/core/browser/webdata/autocomplete_sync_bridge.h" |
| 13 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" | 14 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service
.h" |
| 14 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" | 15 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser
vice.h" |
| 15 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" | 16 #include "components/autofill/core/browser/webdata/autofill_wallet_metadata_sync
able_service.h" |
| 16 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" | 17 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv
ice.h" |
| 17 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" | 18 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" |
| 18 #include "components/browser_sync/browser_sync_switches.h" | 19 #include "components/browser_sync/browser_sync_switches.h" |
| 19 #include "components/browser_sync/profile_sync_components_factory_impl.h" | 20 #include "components/browser_sync/profile_sync_components_factory_impl.h" |
| 20 #include "components/browser_sync/profile_sync_service.h" | 21 #include "components/browser_sync/profile_sync_service.h" |
| 21 #include "components/dom_distiller/core/dom_distiller_service.h" | 22 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 22 #include "components/history/core/browser/history_model_worker.h" | 23 #include "components/history/core/browser/history_model_worker.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 browser_state_) | 338 browser_state_) |
| 338 ->GetDeviceInfoSyncBridge() | 339 ->GetDeviceInfoSyncBridge() |
| 339 ->AsWeakPtr(); | 340 ->AsWeakPtr(); |
| 340 case syncer::READING_LIST: { | 341 case syncer::READING_LIST: { |
| 341 ReadingListModel* reading_list_model = | 342 ReadingListModel* reading_list_model = |
| 342 ReadingListModelFactory::GetForBrowserState(browser_state_); | 343 ReadingListModelFactory::GetForBrowserState(browser_state_); |
| 343 if (reading_list_model) | 344 if (reading_list_model) |
| 344 return reading_list_model->GetModelTypeSyncBridge()->AsWeakPtr(); | 345 return reading_list_model->GetModelTypeSyncBridge()->AsWeakPtr(); |
| 345 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 346 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 346 } | 347 } |
| 348 case syncer::AUTOFILL: |
| 349 return autofill::AutocompleteSyncBridge::FromWebDataService( |
| 350 web_data_service_.get()) |
| 351 ->AsWeakPtr(); |
| 347 default: | 352 default: |
| 348 NOTREACHED(); | 353 NOTREACHED(); |
| 349 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 354 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 350 } | 355 } |
| 351 } | 356 } |
| 352 | 357 |
| 353 scoped_refptr<syncer::ModelSafeWorker> | 358 scoped_refptr<syncer::ModelSafeWorker> |
| 354 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { | 359 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { |
| 355 DCHECK_CURRENTLY_ON(web::WebThread::UI); | 360 DCHECK_CURRENTLY_ON(web::WebThread::UI); |
| 356 switch (group) { | 361 switch (group) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); | 413 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); |
| 409 if (profile_sync_service != nullptr) { | 414 if (profile_sync_service != nullptr) { |
| 410 const syncer::DeviceInfoTracker* tracker = | 415 const syncer::DeviceInfoTracker* tracker = |
| 411 profile_sync_service->GetDeviceInfoTracker(); | 416 profile_sync_service->GetDeviceInfoTracker(); |
| 412 if (tracker != nullptr) { | 417 if (tracker != nullptr) { |
| 413 trackers->push_back(tracker); | 418 trackers->push_back(tracker); |
| 414 } | 419 } |
| 415 } | 420 } |
| 416 } | 421 } |
| 417 } | 422 } |
| OLD | NEW |