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

Side by Side Diff: chrome/browser/sync/chrome_sync_client.cc

Issue 2508263003: [sync] skeleton implementation of AutocompleteSyncBridge (Closed)
Patch Set: Address Max and Pavel's comments 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
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 "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
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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 430 }
430 } 431 }
431 432
432 base::WeakPtr<syncer::ModelTypeSyncBridge> 433 base::WeakPtr<syncer::ModelTypeSyncBridge>
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();
440 case syncer::AUTOFILL:
441 return autofill::AutocompleteSyncBridge::FromWebDataService(
442 web_data_service_.get())
443 ->AsWeakPtr();
439 default: 444 default:
440 NOTREACHED(); 445 NOTREACHED();
441 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); 446 return base::WeakPtr<syncer::ModelTypeSyncBridge>();
442 } 447 }
443 } 448 }
444 449
445 scoped_refptr<syncer::ModelSafeWorker> 450 scoped_refptr<syncer::ModelSafeWorker>
446 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { 451 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) {
447 DCHECK_CURRENTLY_ON(BrowserThread::UI); 452 DCHECK_CURRENTLY_ON(BrowserThread::UI);
448 switch (group) { 453 switch (group) {
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 sync_service->RegisterDataTypeController( 633 sync_service->RegisterDataTypeController(
629 base::MakeUnique<SupervisedUserSyncDataTypeController>( 634 base::MakeUnique<SupervisedUserSyncDataTypeController>(
630 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); 635 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_));
631 sync_service->RegisterDataTypeController( 636 sync_service->RegisterDataTypeController(
632 base::MakeUnique<SupervisedUserSyncDataTypeController>( 637 base::MakeUnique<SupervisedUserSyncDataTypeController>(
633 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); 638 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_));
634 #endif 639 #endif
635 } 640 }
636 641
637 } // namespace browser_sync 642 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698