| 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" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" | 45 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" |
| 46 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 46 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 47 #include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h" | 47 #include "ios/chrome/browser/browser_state/chrome_browser_state_manager.h" |
| 48 #include "ios/chrome/browser/chrome_url_constants.h" | 48 #include "ios/chrome/browser/chrome_url_constants.h" |
| 49 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 49 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 50 #include "ios/chrome/browser/favicon/favicon_service_factory.h" | 50 #include "ios/chrome/browser/favicon/favicon_service_factory.h" |
| 51 #include "ios/chrome/browser/history/history_service_factory.h" | 51 #include "ios/chrome/browser/history/history_service_factory.h" |
| 52 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid
er_factory.h" | 52 #include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provid
er_factory.h" |
| 53 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" | 53 #include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h" |
| 54 #include "ios/chrome/browser/pref_names.h" | 54 #include "ios/chrome/browser/pref_names.h" |
| 55 #include "ios/chrome/browser/reading_list/reading_list_model.h" | |
| 56 #include "ios/chrome/browser/reading_list/reading_list_model_factory.h" | |
| 57 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" | 55 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" |
| 58 #include "ios/chrome/browser/sync/glue/sync_start_util.h" | 56 #include "ios/chrome/browser/sync/glue/sync_start_util.h" |
| 59 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" | 57 #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" |
| 60 #include "ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router
.h" | 58 #include "ios/chrome/browser/sync/sessions/ios_chrome_local_session_event_router
.h" |
| 61 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h" | 59 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h" |
| 62 #include "ios/chrome/browser/web_data_service_factory.h" | 60 #include "ios/chrome/browser/web_data_service_factory.h" |
| 63 #include "ios/chrome/common/channel_info.h" | 61 #include "ios/chrome/common/channel_info.h" |
| 64 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 62 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 65 #include "ios/web/public/web_thread.h" | 63 #include "ios/web/public/web_thread.h" |
| 66 #include "ui/base/device_form_factor.h" | 64 #include "ui/base/device_form_factor.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 328 } |
| 331 | 329 |
| 332 base::WeakPtr<syncer::ModelTypeSyncBridge> | 330 base::WeakPtr<syncer::ModelTypeSyncBridge> |
| 333 IOSChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) { | 331 IOSChromeSyncClient::GetSyncBridgeForModelType(syncer::ModelType type) { |
| 334 switch (type) { | 332 switch (type) { |
| 335 case syncer::DEVICE_INFO: | 333 case syncer::DEVICE_INFO: |
| 336 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( | 334 return IOSChromeProfileSyncServiceFactory::GetForBrowserState( |
| 337 browser_state_) | 335 browser_state_) |
| 338 ->GetDeviceInfoSyncBridge() | 336 ->GetDeviceInfoSyncBridge() |
| 339 ->AsWeakPtr(); | 337 ->AsWeakPtr(); |
| 340 case syncer::READING_LIST: { | |
| 341 ReadingListModel* reading_list_model = | |
| 342 ReadingListModelFactory::GetForBrowserState(browser_state_); | |
| 343 if (reading_list_model) | |
| 344 return reading_list_model->GetModelTypeSyncBridge()->AsWeakPtr(); | |
| 345 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | |
| 346 } | |
| 347 default: | 338 default: |
| 348 NOTREACHED(); | 339 NOTREACHED(); |
| 349 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 340 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 350 } | 341 } |
| 351 } | 342 } |
| 352 | 343 |
| 353 scoped_refptr<syncer::ModelSafeWorker> | 344 scoped_refptr<syncer::ModelSafeWorker> |
| 354 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { | 345 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { |
| 355 DCHECK_CURRENTLY_ON(web::WebThread::UI); | 346 DCHECK_CURRENTLY_ON(web::WebThread::UI); |
| 356 switch (group) { | 347 switch (group) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); | 399 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); |
| 409 if (profile_sync_service != nullptr) { | 400 if (profile_sync_service != nullptr) { |
| 410 const syncer::DeviceInfoTracker* tracker = | 401 const syncer::DeviceInfoTracker* tracker = |
| 411 profile_sync_service->GetDeviceInfoTracker(); | 402 profile_sync_service->GetDeviceInfoTracker(); |
| 412 if (tracker != nullptr) { | 403 if (tracker != nullptr) { |
| 413 trackers->push_back(tracker); | 404 trackers->push_back(tracker); |
| 414 } | 405 } |
| 415 } | 406 } |
| 416 } | 407 } |
| 417 } | 408 } |
| OLD | NEW |