Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: ios/chrome/browser/sync/ios_chrome_sync_client.mm

Issue 2508263003: [sync] skeleton implementation of AutocompleteSyncBridge (Closed)
Patch Set: Max's comments; merged chrome_sync_client Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/webdata_services/web_data_service_wrapper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( 342 return IOSChromeProfileSyncServiceFactory::GetForBrowserState(
342 browser_state_) 343 browser_state_)
343 ->GetDeviceInfoSyncBridge() 344 ->GetDeviceInfoSyncBridge()
344 ->AsWeakPtr(); 345 ->AsWeakPtr();
345 case syncer::READING_LIST: { 346 case syncer::READING_LIST: {
346 DCHECK(reading_list::switches::IsReadingListEnabled()); 347 DCHECK(reading_list::switches::IsReadingListEnabled());
347 ReadingListModel* reading_list_model = 348 ReadingListModel* reading_list_model =
348 ReadingListModelFactory::GetForBrowserState(browser_state_); 349 ReadingListModelFactory::GetForBrowserState(browser_state_);
349 return reading_list_model->GetModelTypeSyncBridge()->AsWeakPtr(); 350 return reading_list_model->GetModelTypeSyncBridge()->AsWeakPtr();
350 } 351 }
352 case syncer::AUTOFILL:
353 return autofill::AutocompleteSyncBridge::FromWebDataService(
354 web_data_service_.get())
355 ->AsWeakPtr();
351 default: 356 default:
352 NOTREACHED(); 357 NOTREACHED();
353 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); 358 return base::WeakPtr<syncer::ModelTypeSyncBridge>();
354 } 359 }
355 } 360 }
356 361
357 scoped_refptr<syncer::ModelSafeWorker> 362 scoped_refptr<syncer::ModelSafeWorker>
358 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { 363 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) {
359 DCHECK_CURRENTLY_ON(web::WebThread::UI); 364 DCHECK_CURRENTLY_ON(web::WebThread::UI);
360 switch (group) { 365 switch (group) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); 417 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state);
413 if (profile_sync_service != nullptr) { 418 if (profile_sync_service != nullptr) {
414 const syncer::DeviceInfoTracker* tracker = 419 const syncer::DeviceInfoTracker* tracker =
415 profile_sync_service->GetDeviceInfoTracker(); 420 profile_sync_service->GetDeviceInfoTracker();
416 if (tracker != nullptr) { 421 if (tracker != nullptr) {
417 trackers->push_back(tracker); 422 trackers->push_back(tracker);
418 } 423 }
419 } 424 }
420 } 425 }
421 } 426 }
OLDNEW
« no previous file with comments | « components/webdata_services/web_data_service_wrapper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698