OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "components/autofill/core/browser/webdata/web_data_model_type_controlle
r.h" |
| 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" |
| 9 |
| 10 using syncer::ModelType; |
| 11 using syncer::ModelTypeController; |
| 12 using syncer::SyncClient; |
| 13 |
| 14 namespace autofill { |
| 15 |
| 16 WebDataModelTypeController::WebDataModelTypeController( |
| 17 ModelType type, |
| 18 SyncClient* sync_client, |
| 19 const scoped_refptr<base::SingleThreadTaskRunner>& model_thread, |
| 20 const scoped_refptr<AutofillWebDataService>& web_data_service, |
| 21 const BridgeFromWebData& bridge_from_web_data) |
| 22 : ModelTypeController(type, sync_client, model_thread), |
| 23 web_data_service_(web_data_service), |
| 24 bridge_from_web_data_(bridge_from_web_data) {} |
| 25 |
| 26 WebDataModelTypeController::~WebDataModelTypeController() {} |
| 27 |
| 28 ModelTypeController::BridgeProvider |
| 29 WebDataModelTypeController::GetBridgeProvider() { |
| 30 // As opposed to the default implementation, get the bridge on demand, the web |
| 31 // data service requires us to be on the model thread. |
| 32 return base::Bind(bridge_from_web_data_, |
| 33 base::RetainedRef(web_data_service_)); |
| 34 } |
| 35 |
| 36 } // namespace autofill |
OLD | NEW |