diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 23:24:14 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-18 23:24:14 +0000 |
commit | db8635032b1f83436a072be14e425076a7bd8164 (patch) | |
tree | 8af2963301fafd66e4bfb7ff0a9f77ed0ad526d1 /webkit/glue/editor_client_impl.h | |
parent | 217eae872ac412240854936ee20878636d555c53 (diff) | |
download | chromium_src-db8635032b1f83436a072be14e425076a7bd8164.zip chromium_src-db8635032b1f83436a072be14e425076a7bd8164.tar.gz chromium_src-db8635032b1f83436a072be14e425076a7bd8164.tar.bz2 |
We now show the form autofill when the user does any of these on a focused empty text-field:
- presses the up/down arrow key
- left-clicks it
The other browsers have that feature.
BUG=5130
TEST=See bug.
Review URL: http://codereview.chromium.org/14852
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7269 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/editor_client_impl.h')
-rw-r--r-- | webkit/glue/editor_client_impl.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/webkit/glue/editor_client_impl.h b/webkit/glue/editor_client_impl.h index 3870923..daef0fb 100644 --- a/webkit/glue/editor_client_impl.h +++ b/webkit/glue/editor_client_impl.h @@ -119,11 +119,28 @@ class EditorClientImpl : public WebCore::EditorClient { virtual std::wstring Describe(WebCore::EAffinity affinity); virtual std::wstring Describe(WebCore::CSSStyleDeclaration* style); + // Shows the autofill popup for |node| if it is an HTMLInputElement and it is + // empty. This is called when you press the up or down arrow in a text field + // or when clicking an already focused text-field. + virtual void ShowAutofillForNode(WebCore::Node* node); + private: void ModifySelection(WebCore::Frame* frame, WebCore::KeyboardEvent* event); - void DoAutofill(WebCore::HTMLInputElement* input_element, bool backspace); + // Popups an autofill menu for |input_element| is applicable. + // |autofill_on_empty_value| indicates whether the autofill should be shown + // when the text-field is empty. + void Autofill(WebCore::HTMLInputElement* input_element, + bool autofill_on_empty_value); + + // This method is invoked later by Autofill() as when Autofill() is invoked + // (from one of the EditorClient callback) the carret position is not + // reflecting the last text change yet and we need it to decide whether or not + // to show the autofill popup. + void DoAutofill(WebCore::HTMLInputElement* input_element, + bool autofill_on_empty_value, + bool backspace); protected: WebViewImpl* web_view_; |