stub_autofill_provider.cc 1004 B

1234567891011121314151617181920212223242526272829
  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. #include "weblayer/test/stub_autofill_provider.h"
  5. namespace weblayer {
  6. StubAutofillProvider::StubAutofillProvider(
  7. content::WebContents* web_contents,
  8. const base::RepeatingCallback<void(const autofill::FormData&)>&
  9. on_received_form_data)
  10. : autofill::TestAutofillProvider(web_contents),
  11. on_received_form_data_(on_received_form_data) {}
  12. StubAutofillProvider::~StubAutofillProvider() = default;
  13. void StubAutofillProvider::OnAskForValuesToFill(
  14. autofill::AndroidAutofillManager* manager,
  15. const autofill::FormData& form,
  16. const autofill::FormFieldData& field,
  17. const gfx::RectF& bounding_box,
  18. int32_t query_id,
  19. bool /*unused_autoselect_first_suggestion*/,
  20. autofill::TouchToFillEligible /*unused_touch_to_fill_eligible*/) {
  21. on_received_form_data_.Run(form);
  22. }
  23. } // namespace weblayer