15267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)/*
25267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * Copyright (C) 2010 Google Inc. All rights reserved.
35267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *
45267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without
55267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * modification, are permitted provided that the following conditions are
65267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * met:
75267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *
85267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *     * Redistributions of source code must retain the above copyright
95267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * notice, this list of conditions and the following disclaimer.
105267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *     * Redistributions in binary form must reproduce the above
115267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
125267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * in the documentation and/or other materials provided with the
135267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * distribution.
145267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *     * Neither the name of Google Inc. nor the names of its
155267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * contributors may be used to endorse or promote products derived from
165267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * this software without specific prior written permission.
175267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) *
185267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
195267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
205267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
215267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
225267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
235267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
245267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
255267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
265267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
275267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
285267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
295267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles) */
305267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
315267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#ifndef WebAutofillClient_h
325267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#define WebAutofillClient_h
335267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
3451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
355267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
36d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)class WebFormControlElement;
375267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)class WebFormElement;
385267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)class WebInputElement;
395267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)class WebKeyboardEvent;
405267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)class WebNode;
415267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
425267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)template <typename T> class WebVector;
435267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
445267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)class WebAutofillClient {
455267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)public:
465267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    // Informs the browser an interactive autocomplete has been requested.
47f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles)    virtual void didRequestAutocomplete(const WebFormElement&) { }
485267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
495267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    // These methods are called when the users edits a text-field.
505267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    virtual void textFieldDidEndEditing(const WebInputElement&) { }
51d5428f32f5d1719f774f62e19147104ca245a3abTorne (Richard Coles)    virtual void textFieldDidChange(const WebFormControlElement&) { }
525267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    virtual void textFieldDidReceiveKeyDown(const WebInputElement&, const WebKeyboardEvent&) { }
5309380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // This is called when a datalist indicator is clicked.
5409380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    virtual void openTextDataListChooser(const WebInputElement&) { }
5510f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch    // Called the first time the user interacts with the page after a load.
5610f88d5669dbd969c059d61ba09fa37dd72ac559Ben Murdoch    virtual void firstUserGestureObserved() { }
575267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
585267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    // Informs the client whether or not any subsequent text changes should be ignored.
595267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    virtual void setIgnoreTextChanges(bool ignore) { }
605267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
615267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    virtual void didAssociateFormControls(const WebVector<WebNode>&) { }
625267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
635267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)protected:
645267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)    virtual ~WebAutofillClient() { }
655267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)};
665267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
6751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
685267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)
695267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#endif
70