| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/browser_sync/browser/profile_sync_test_util.h" | 5 #include "components/browser_sync/browser/profile_sync_test_util.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/bookmarks/browser/bookmark_model.h" | 8 #include "components/bookmarks/browser/bookmark_model.h" |
| 9 #include "components/history/core/browser/history_model_worker.h" | 9 #include "components/history/core/browser/history_model_worker.h" |
| 10 #include "components/pref_registry/pref_registry_syncable.h" | 10 #include "components/pref_registry/pref_registry_syncable.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 210 } |
| 211 | 211 |
| 212 void ProfileSyncServiceBundle::SyncClientBuilder::SetBookmarkModelCallback( | 212 void ProfileSyncServiceBundle::SyncClientBuilder::SetBookmarkModelCallback( |
| 213 const base::Callback<bookmarks::BookmarkModel*(void)>& | 213 const base::Callback<bookmarks::BookmarkModel*(void)>& |
| 214 get_bookmark_model_callback) { | 214 get_bookmark_model_callback) { |
| 215 get_bookmark_model_callback_ = get_bookmark_model_callback; | 215 get_bookmark_model_callback_ = get_bookmark_model_callback; |
| 216 } | 216 } |
| 217 | 217 |
| 218 std::unique_ptr<sync_driver::FakeSyncClient> | 218 std::unique_ptr<sync_driver::FakeSyncClient> |
| 219 ProfileSyncServiceBundle::SyncClientBuilder::Build() { | 219 ProfileSyncServiceBundle::SyncClientBuilder::Build() { |
| 220 return base::WrapUnique(new BundleSyncClient( | 220 return base::MakeUnique<BundleSyncClient>( |
| 221 bundle_->component_factory(), bundle_->pref_service(), | 221 bundle_->component_factory(), bundle_->pref_service(), |
| 222 bundle_->sync_sessions_client(), personal_data_manager_, | 222 bundle_->sync_sessions_client(), personal_data_manager_, |
| 223 get_syncable_service_callback_, get_sync_service_callback_, | 223 get_syncable_service_callback_, get_sync_service_callback_, |
| 224 get_bookmark_model_callback_, | 224 get_bookmark_model_callback_, |
| 225 activate_model_creation_ ? bundle_->db_thread() : nullptr, | 225 activate_model_creation_ ? bundle_->db_thread() : nullptr, |
| 226 activate_model_creation_ ? base::ThreadTaskRunnerHandle::Get() : nullptr, | 226 activate_model_creation_ ? base::ThreadTaskRunnerHandle::Get() : nullptr, |
| 227 history_service_)); | 227 history_service_); |
| 228 } | 228 } |
| 229 | 229 |
| 230 ProfileSyncServiceBundle::ProfileSyncServiceBundle() | 230 ProfileSyncServiceBundle::ProfileSyncServiceBundle() |
| 231 : db_thread_(base::ThreadTaskRunnerHandle::Get()), | 231 : db_thread_(base::ThreadTaskRunnerHandle::Get()), |
| 232 worker_pool_owner_(2, "sync test worker pool"), | 232 worker_pool_owner_(2, "sync test worker pool"), |
| 233 signin_client_(&pref_service_), | 233 signin_client_(&pref_service_), |
| 234 #if defined(OS_CHROMEOS) | 234 #if defined(OS_CHROMEOS) |
| 235 signin_manager_(&signin_client_, &account_tracker_), | 235 signin_manager_(&signin_client_, &account_tracker_), |
| 236 #else | 236 #else |
| 237 signin_manager_(&signin_client_, | 237 signin_manager_(&signin_client_, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 250 ProfileSyncServiceBundle::~ProfileSyncServiceBundle() {} | 250 ProfileSyncServiceBundle::~ProfileSyncServiceBundle() {} |
| 251 | 251 |
| 252 ProfileSyncService::InitParams ProfileSyncServiceBundle::CreateBasicInitParams( | 252 ProfileSyncService::InitParams ProfileSyncServiceBundle::CreateBasicInitParams( |
| 253 ProfileSyncService::StartBehavior start_behavior, | 253 ProfileSyncService::StartBehavior start_behavior, |
| 254 std::unique_ptr<sync_driver::SyncClient> sync_client) { | 254 std::unique_ptr<sync_driver::SyncClient> sync_client) { |
| 255 ProfileSyncService::InitParams init_params; | 255 ProfileSyncService::InitParams init_params; |
| 256 | 256 |
| 257 init_params.start_behavior = start_behavior; | 257 init_params.start_behavior = start_behavior; |
| 258 init_params.sync_client = std::move(sync_client); | 258 init_params.sync_client = std::move(sync_client); |
| 259 init_params.signin_wrapper = | 259 init_params.signin_wrapper = |
| 260 base::WrapUnique(new SigninManagerWrapper(signin_manager())); | 260 base::MakeUnique<SigninManagerWrapper>(signin_manager()); |
| 261 init_params.oauth2_token_service = auth_service(); | 261 init_params.oauth2_token_service = auth_service(); |
| 262 init_params.network_time_update_callback = | 262 init_params.network_time_update_callback = |
| 263 base::Bind(&EmptyNetworkTimeUpdate); | 263 base::Bind(&EmptyNetworkTimeUpdate); |
| 264 init_params.base_directory = base::FilePath(FILE_PATH_LITERAL("dummyPath")); | 264 init_params.base_directory = base::FilePath(FILE_PATH_LITERAL("dummyPath")); |
| 265 init_params.url_request_context = url_request_context(); | 265 init_params.url_request_context = url_request_context(); |
| 266 init_params.debug_identifier = "dummyDebugName"; | 266 init_params.debug_identifier = "dummyDebugName"; |
| 267 init_params.channel = version_info::Channel::UNKNOWN; | 267 init_params.channel = version_info::Channel::UNKNOWN; |
| 268 init_params.db_thread = db_thread_; | 268 init_params.db_thread = db_thread_; |
| 269 init_params.file_thread = base::ThreadTaskRunnerHandle::Get(); | 269 init_params.file_thread = base::ThreadTaskRunnerHandle::Get(); |
| 270 init_params.blocking_pool = worker_pool_owner_.pool().get(); | 270 init_params.blocking_pool = worker_pool_owner_.pool().get(); |
| 271 | 271 |
| 272 return init_params; | 272 return init_params; |
| 273 } | 273 } |
| 274 | 274 |
| 275 } // namespace browser_sync | 275 } // namespace browser_sync |
| OLD | NEW |