| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 | 376 |
| 377 scoped_refptr<syncer::ModelSafeWorker> | 377 scoped_refptr<syncer::ModelSafeWorker> |
| 378 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { | 378 IOSChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { |
| 379 DCHECK_CURRENTLY_ON(web::WebThread::UI); | 379 DCHECK_CURRENTLY_ON(web::WebThread::UI); |
| 380 switch (group) { | 380 switch (group) { |
| 381 case syncer::GROUP_DB: | 381 case syncer::GROUP_DB: |
| 382 return new syncer::SequencedModelWorker( | 382 return new syncer::SequencedModelWorker( |
| 383 web::WebThread::GetTaskRunnerForThread(web::WebThread::DB), | 383 web::WebThread::GetTaskRunnerForThread(web::WebThread::DB), |
| 384 syncer::GROUP_DB); | 384 syncer::GROUP_DB); |
| 385 case syncer::GROUP_FILE: | |
| 386 return new syncer::SequencedModelWorker( | |
| 387 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE), | |
| 388 syncer::GROUP_FILE); | |
| 389 case syncer::GROUP_UI: | 385 case syncer::GROUP_UI: |
| 390 return new syncer::UIModelWorker( | 386 return new syncer::UIModelWorker( |
| 391 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); | 387 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); |
| 392 case syncer::GROUP_PASSIVE: | 388 case syncer::GROUP_PASSIVE: |
| 393 return new syncer::PassiveModelWorker(); | 389 return new syncer::PassiveModelWorker(); |
| 394 case syncer::GROUP_HISTORY: { | 390 case syncer::GROUP_HISTORY: { |
| 395 history::HistoryService* history_service = GetHistoryService(); | 391 history::HistoryService* history_service = GetHistoryService(); |
| 396 if (!history_service) | 392 if (!history_service) |
| 397 return nullptr; | 393 return nullptr; |
| 398 return new browser_sync::HistoryModelWorker( | 394 return new browser_sync::HistoryModelWorker( |
| 399 history_service->AsWeakPtr(), | 395 history_service->AsWeakPtr(), |
| 400 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); | 396 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI)); |
| 401 } | 397 } |
| 402 case syncer::GROUP_PASSWORD: { | 398 case syncer::GROUP_PASSWORD: { |
| 403 if (!password_store_) | 399 if (!password_store_) |
| 404 return nullptr; | 400 return nullptr; |
| 405 return new browser_sync::PasswordModelWorker(password_store_); | 401 return new browser_sync::PasswordModelWorker(password_store_); |
| 406 } | 402 } |
| 407 default: | 403 default: |
| 404 NOTREACHED(); |
| 408 return nullptr; | 405 return nullptr; |
| 409 } | 406 } |
| 410 } | 407 } |
| 411 | 408 |
| 412 syncer::SyncApiComponentFactory* | 409 syncer::SyncApiComponentFactory* |
| 413 IOSChromeSyncClient::GetSyncApiComponentFactory() { | 410 IOSChromeSyncClient::GetSyncApiComponentFactory() { |
| 414 return component_factory_.get(); | 411 return component_factory_.get(); |
| 415 } | 412 } |
| 416 | 413 |
| 417 void IOSChromeSyncClient::SetSyncApiComponentFactoryForTesting( | 414 void IOSChromeSyncClient::SetSyncApiComponentFactoryForTesting( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 432 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); | 429 IOSChromeProfileSyncServiceFactory::GetForBrowserState(browser_state); |
| 433 if (profile_sync_service != nullptr) { | 430 if (profile_sync_service != nullptr) { |
| 434 const syncer::DeviceInfoTracker* tracker = | 431 const syncer::DeviceInfoTracker* tracker = |
| 435 profile_sync_service->GetDeviceInfoTracker(); | 432 profile_sync_service->GetDeviceInfoTracker(); |
| 436 if (tracker != nullptr) { | 433 if (tracker != nullptr) { |
| 437 trackers->push_back(tracker); | 434 trackers->push_back(tracker); |
| 438 } | 435 } |
| 439 } | 436 } |
| 440 } | 437 } |
| 441 } | 438 } |
| OLD | NEW |