diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 19:28:08 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 19:28:08 +0000 |
commit | 89ac46c97e6a3b2f2726bd11d52824d27ee26a24 (patch) | |
tree | c976f9689ff7fabd3c3e54e06ed051d1bd4544c7 /webkit/glue/webview_impl.h | |
parent | 9ac105a1023bc696e619e5714c524e1a3ffdc2ef (diff) | |
download | chromium_src-89ac46c97e6a3b2f2726bd11d52824d27ee26a24.zip chromium_src-89ac46c97e6a3b2f2726bd11d52824d27ee26a24.tar.gz chromium_src-89ac46c97e6a3b2f2726bd11d52824d27ee26a24.tar.bz2 |
This CL adds the autofill UI in forms.
When the user types text in a text field in a form, the renderer queries the browser for suggestion based on the entered text and displays the suggestions in a popup.
Listeners are set on the form text field in a similar fashion than for password save.
The popup showing the suggestion uses the same mechanism as the select popup. Note that a difference between the select and the autofill popup is that the autofill should not take focus, so the page still has focus and the user can still type in while it shows.
The creation of the render widget was modified for that purpose so we can specify the popup should not be focused when shown.
Review URL: http://codereview.chromium.org/8885
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webview_impl.h')
-rw-r--r-- | webkit/glue/webview_impl.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/webkit/glue/webview_impl.h b/webkit/glue/webview_impl.h index 9bc6c4b..5d66def 100644 --- a/webkit/glue/webview_impl.h +++ b/webkit/glue/webview_impl.h @@ -27,10 +27,12 @@ class HistoryItem; class KeyboardEvent; class Page; class PlatformKeyboardEvent; +class PopupContainer; class Range; class Widget; } +class AutocompletePopupMenuClient; class ImageResourceFetcher; class SearchableFormData; struct WebDropData; @@ -96,6 +98,10 @@ class WebViewImpl : public WebView, public WebCore::BackForwardListClient { virtual void DragTargetDragLeave(); virtual void DragTargetDrop( int client_x, int client_y, int screen_x, int screen_y); + virtual void AutofillSuggestionsForNode( + int64 node_id, + const std::vector<std::wstring>& suggestions, + int default_suggestion_index); // WebViewImpl @@ -176,6 +182,9 @@ class WebViewImpl : public WebView, public WebCore::BackForwardListClient { bool errored, const SkBitmap& image); + // Hides the autocomplete popup if it is showing. + void HideAutoCompletePopup(); + protected: friend class WebView; // So WebView::Create can call our constructor @@ -285,6 +294,13 @@ class WebViewImpl : public WebView, public WebCore::BackForwardListClient { // Represents whether or not this object should process incoming IME events. bool ime_accept_events_; + // The currently shown autocomplete popup. + RefPtr<WebCore::PopupContainer> autocomplete_popup_; + + // The popup client of the currently shown autocomplete popup. Necessary for + // managing the life of the client. + RefPtr<AutocompletePopupMenuClient> autocomplete_popup_client_; + // HACK: current_input_event is for ChromeClientImpl::show(), until we can fix // WebKit to pass enough information up into ChromeClient::show() so we can // decide if the window.open event was caused by a middle-mouse click |