1eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch// Copyright 2013 The Chromium Authors. All rights reserved. 22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file. 42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 5eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "components/autofill/core/browser/test_autofill_external_delegate.h" 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ui/gfx/rect.h" 82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace autofill { 102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)void GenerateTestAutofillPopup( 122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) AutofillExternalDelegate* autofill_external_delegate) { 132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int query_id = 1; 142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) FormData form; 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) FormFieldData field; 162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) field.is_focusable = true; 172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) field.should_autocomplete = true; 182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) gfx::RectF bounds(100.f, 100.f); 192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) autofill_external_delegate->OnQuery(query_id, form, field, bounds, false); 202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 21c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) std::vector<base::string16> autofill_item; 22c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) autofill_item.push_back(base::string16()); 232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) std::vector<int> autofill_id; 242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) autofill_id.push_back(0); 252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) autofill_external_delegate->OnSuggestionsReturned( 262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) query_id, autofill_item, autofill_item, autofill_item, autofill_id); 272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)} // namespace autofill 30