1 // Copyright 2019 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 "weblayer/test/stub_autofill_provider.h"
6
7 namespace weblayer {
8
StubAutofillProvider(const base::RepeatingCallback<void (const autofill::FormData &)> & on_received_form_data)9 StubAutofillProvider::StubAutofillProvider(
10 const base::RepeatingCallback<void(const autofill::FormData&)>&
11 on_received_form_data)
12 : on_received_form_data_(on_received_form_data) {}
13
14 StubAutofillProvider::~StubAutofillProvider() = default;
15
OnQueryFormFieldAutofill(autofill::AutofillHandlerProxy * handler,int32_t id,const autofill::FormData & form,const autofill::FormFieldData & field,const gfx::RectF & bounding_box,bool)16 void StubAutofillProvider::OnQueryFormFieldAutofill(
17 autofill::AutofillHandlerProxy* handler,
18 int32_t id,
19 const autofill::FormData& form,
20 const autofill::FormFieldData& field,
21 const gfx::RectF& bounding_box,
22 bool /*unused_autoselect_first_suggestion*/) {
23 on_received_form_data_.Run(form);
24 }
25
26 } // namespace weblayer
27