| 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 "chrome/browser/sync/chrome_sync_client.h" | 5 #include "chrome/browser/sync/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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "components/password_manager/core/browser/password_store.h" | 58 #include "components/password_manager/core/browser/password_store.h" |
| 59 #include "components/password_manager/sync/browser/password_model_worker.h" | 59 #include "components/password_manager/sync/browser/password_model_worker.h" |
| 60 #include "components/search_engines/search_engine_data_type_controller.h" | 60 #include "components/search_engines/search_engine_data_type_controller.h" |
| 61 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 61 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 62 #include "components/spellcheck/spellcheck_build_features.h" | 62 #include "components/spellcheck/spellcheck_build_features.h" |
| 63 #include "components/sync/base/pref_names.h" | 63 #include "components/sync/base/pref_names.h" |
| 64 #include "components/sync/base/report_unrecoverable_error.h" | 64 #include "components/sync/base/report_unrecoverable_error.h" |
| 65 #include "components/sync/driver/async_directory_type_controller.h" | 65 #include "components/sync/driver/async_directory_type_controller.h" |
| 66 #include "components/sync/driver/sync_api_component_factory.h" | 66 #include "components/sync/driver/sync_api_component_factory.h" |
| 67 #include "components/sync/driver/sync_util.h" | 67 #include "components/sync/driver/sync_util.h" |
| 68 #include "components/sync/engine/browser_thread_model_worker.h" | |
| 69 #include "components/sync/engine/passive_model_worker.h" | 68 #include "components/sync/engine/passive_model_worker.h" |
| 69 #include "components/sync/engine/sequenced_model_worker.h" |
| 70 #include "components/sync/engine/ui_model_worker.h" | 70 #include "components/sync/engine/ui_model_worker.h" |
| 71 #include "components/sync/user_events/user_event_service.h" | 71 #include "components/sync/user_events/user_event_service.h" |
| 72 #include "components/sync_preferences/pref_service_syncable.h" | 72 #include "components/sync_preferences/pref_service_syncable.h" |
| 73 #include "components/sync_sessions/favicon_cache.h" | 73 #include "components/sync_sessions/favicon_cache.h" |
| 74 #include "components/sync_sessions/sync_sessions_client.h" | 74 #include "components/sync_sessions/sync_sessions_client.h" |
| 75 #include "content/public/browser/browser_thread.h" | 75 #include "content/public/browser/browser_thread.h" |
| 76 #include "extensions/features/features.h" | 76 #include "extensions/features/features.h" |
| 77 #include "ui/base/device_form_factor.h" | 77 #include "ui/base/device_form_factor.h" |
| 78 | 78 |
| 79 #if BUILDFLAG(ENABLE_APP_LIST) | 79 #if BUILDFLAG(ENABLE_APP_LIST) |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 NOTREACHED(); | 526 NOTREACHED(); |
| 527 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); | 527 return base::WeakPtr<syncer::ModelTypeSyncBridge>(); |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 | 530 |
| 531 scoped_refptr<syncer::ModelSafeWorker> | 531 scoped_refptr<syncer::ModelSafeWorker> |
| 532 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { | 532 ChromeSyncClient::CreateModelWorkerForGroup(syncer::ModelSafeGroup group) { |
| 533 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 533 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 534 switch (group) { | 534 switch (group) { |
| 535 case syncer::GROUP_DB: | 535 case syncer::GROUP_DB: |
| 536 return new syncer::BrowserThreadModelWorker( | 536 return new syncer::SequencedModelWorker( |
| 537 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), | 537 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), |
| 538 syncer::GROUP_DB); | 538 syncer::GROUP_DB); |
| 539 case syncer::GROUP_FILE: | 539 case syncer::GROUP_FILE: |
| 540 return new syncer::BrowserThreadModelWorker( | 540 return new syncer::SequencedModelWorker( |
| 541 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 541 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 542 syncer::GROUP_FILE); | 542 syncer::GROUP_FILE); |
| 543 case syncer::GROUP_UI: | 543 case syncer::GROUP_UI: |
| 544 return new syncer::UIModelWorker( | 544 return new syncer::UIModelWorker( |
| 545 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); | 545 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI)); |
| 546 case syncer::GROUP_PASSIVE: | 546 case syncer::GROUP_PASSIVE: |
| 547 return new syncer::PassiveModelWorker(); | 547 return new syncer::PassiveModelWorker(); |
| 548 case syncer::GROUP_HISTORY: { | 548 case syncer::GROUP_HISTORY: { |
| 549 history::HistoryService* history_service = GetHistoryService(); | 549 history::HistoryService* history_service = GetHistoryService(); |
| 550 if (!history_service) | 550 if (!history_service) |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 sync_service->RegisterDataTypeController( | 718 sync_service->RegisterDataTypeController( |
| 719 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 719 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 720 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); | 720 syncer::SUPERVISED_USER_SETTINGS, error_callback, this, profile_)); |
| 721 sync_service->RegisterDataTypeController( | 721 sync_service->RegisterDataTypeController( |
| 722 base::MakeUnique<SupervisedUserSyncDataTypeController>( | 722 base::MakeUnique<SupervisedUserSyncDataTypeController>( |
| 723 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); | 723 syncer::SUPERVISED_USER_WHITELISTS, error_callback, this, profile_)); |
| 724 #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) | 724 #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 725 } | 725 } |
| 726 | 726 |
| 727 } // namespace browser_sync | 727 } // namespace browser_sync |
| OLD | NEW |