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

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

Issue 2511723002: Enable RL sync by default on iOS (Closed)
Patch Set: rebase 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 | « ios/chrome/browser/sync/BUILD.gn ('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_syncable_service .h" 13 #include "components/autofill/core/browser/webdata/autocomplete_syncable_service .h"
14 #include "components/autofill/core/browser/webdata/autofill_profile_syncable_ser vice.h" 14 #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" 15 #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" 16 #include "components/autofill/core/browser/webdata/autofill_wallet_syncable_serv ice.h"
17 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 17 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
18 #include "components/browser_sync/browser_sync_switches.h" 18 #include "components/browser_sync/browser_sync_switches.h"
19 #include "components/browser_sync/profile_sync_components_factory_impl.h" 19 #include "components/browser_sync/profile_sync_components_factory_impl.h"
20 #include "components/browser_sync/profile_sync_service.h" 20 #include "components/browser_sync/profile_sync_service.h"
21 #include "components/dom_distiller/core/dom_distiller_service.h" 21 #include "components/dom_distiller/core/dom_distiller_service.h"
22 #include "components/history/core/browser/history_model_worker.h" 22 #include "components/history/core/browser/history_model_worker.h"
23 #include "components/history/core/browser/history_service.h" 23 #include "components/history/core/browser/history_service.h"
24 #include "components/invalidation/impl/profile_invalidation_provider.h" 24 #include "components/invalidation/impl/profile_invalidation_provider.h"
25 #include "components/keyed_service/core/service_access_type.h" 25 #include "components/keyed_service/core/service_access_type.h"
26 #include "components/password_manager/core/browser/password_store.h" 26 #include "components/password_manager/core/browser/password_store.h"
27 #include "components/password_manager/sync/browser/password_model_worker.h" 27 #include "components/password_manager/sync/browser/password_model_worker.h"
28 #include "components/reading_list/reading_list_model.h" 28 #include "components/reading_list/core/reading_list_switches.h"
29 #include "components/reading_list/ios/reading_list_model.h"
29 #include "components/search_engines/search_engine_data_type_controller.h" 30 #include "components/search_engines/search_engine_data_type_controller.h"
30 #include "components/signin/core/browser/profile_oauth2_token_service.h" 31 #include "components/signin/core/browser/profile_oauth2_token_service.h"
31 #include "components/sync/base/extensions_activity.h" 32 #include "components/sync/base/extensions_activity.h"
32 #include "components/sync/base/report_unrecoverable_error.h" 33 #include "components/sync/base/report_unrecoverable_error.h"
33 #include "components/sync/driver/sync_api_component_factory.h" 34 #include "components/sync/driver/sync_api_component_factory.h"
34 #include "components/sync/driver/sync_util.h" 35 #include "components/sync/driver/sync_util.h"
35 #include "components/sync/driver/ui_data_type_controller.h" 36 #include "components/sync/driver/ui_data_type_controller.h"
36 #include "components/sync/engine/browser_thread_model_worker.h" 37 #include "components/sync/engine/browser_thread_model_worker.h"
37 #include "components/sync/engine/passive_model_worker.h" 38 #include "components/sync/engine/passive_model_worker.h"
38 #include "components/sync/engine/ui_model_worker.h" 39 #include "components/sync/engine/ui_model_worker.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 336
336 base::WeakPtr<syncer::ModelTypeSyncBridge> 337 base::WeakPtr<syncer::ModelTypeSyncBridge>
337 IOSChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) { 338 IOSChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) {
338 switch (type) { 339 switch (type) {
339 case syncer::DEVICE_INFO: 340 case syncer::DEVICE_INFO:
340 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( 341 return IOSChromeProfileSyncServiceFactory::GetForBrowserState(
341 browser_state_) 342 browser_state_)
342 ->GetDeviceInfoSyncBridge() 343 ->GetDeviceInfoSyncBridge()
343 ->AsWeakPtr(); 344 ->AsWeakPtr();
344 case syncer::READING_LIST: { 345 case syncer::READING_LIST: {
346 DCHECK(reading_list::switches::IsReadingListEnabled());
345 ReadingListModel* reading_list_model = 347 ReadingListModel* reading_list_model =
346 ReadingListModelFactory::GetForBrowserState(browser_state_); 348 ReadingListModelFactory::GetForBrowserState(browser_state_);
347 if (reading_list_model) 349 return reading_list_model->GetModelTypeSyncBridge()->AsWeakPtr();
348 return reading_list_model->GetModelTypeSyncBridge()->AsWeakPtr();
349 return base::WeakPtr<syncer::ModelTypeSyncBridge>();
350 } 350 }
351 default: 351 default:
352 NOTREACHED(); 352 NOTREACHED();
353 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); 353 return base::WeakPtr<syncer::ModelTypeSyncBridge>();
354 } 354 }
355 } 355 }
356 356
357 scoped_refptr<syncer::ModelSafeWorker> 357 scoped_refptr<syncer::ModelSafeWorker>
358 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { 358 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) {
359 DCHECK_CURRENTLY_ON(web::WebThread::UI); 359 DCHECK_CURRENTLY_ON(web::WebThread::UI);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); 412 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state);
413 if (profile_sync_service != nullptr) { 413 if (profile_sync_service != nullptr) {
414 const syncer::DeviceInfoTracker* tracker = 414 const syncer::DeviceInfoTracker* tracker =
415 profile_sync_service->GetDeviceInfoTracker(); 415 profile_sync_service->GetDeviceInfoTracker();
416 if (tracker != nullptr) { 416 if (tracker != nullptr) {
417 trackers->push_back(tracker); 417 trackers->push_back(tracker);
418 } 418 }
419 } 419 }
420 } 420 }
421 } 421 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/sync/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698