summaryrefslogtreecommitdiffstats
path: root/webkit/glue/editor_client_impl.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 18:45:26 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 18:45:26 +0000
commit36e401c9419d17274a4d36da091ad7cb161ca750 (patch)
tree41ac830cff1d4edde1d60a5b13fa355ace02d970 /webkit/glue/editor_client_impl.h
parent9bd47420c0bc5ce8688f7a2b5fdf9676fa7788a9 (diff)
downloadchromium_src-36e401c9419d17274a4d36da091ad7cb161ca750.zip
chromium_src-36e401c9419d17274a4d36da091ad7cb161ca750.tar.gz
chromium_src-36e401c9419d17274a4d36da091ad7cb161ca750.tar.bz2
Changed the behavior of the form autofill popup.
There are 3 ways to bring up the form autofill: 1 - start typing some text in a form text field 2 - press key down/up when the focus is on a form text field 3 - click an already focused form text field In all these cases, our current behavior is to show the form autofill only if the caret is at the end of the text field. Other browsers' behavior: IE shows the autofill popup in all 3 cases regardless of the caret position FF shows the autofill popup regardless of the caret position for case 2 and 3 but not 1. Safari never shows an autofill popup for cases 2 and 3, it shows the autofill popup for case 1 only if the caret is at the end. This CL changes our behavior to be like FF. Also this CL now lets the default processing of key up/down events happen in the case where we are showing an autofill. We were preventing default handling as it moves the caret. Since were showing the autofill in a posted task and we would check that the caret was at the end, this would prevent the autofill from showing. Now that we don't enforce the caret at the end condition with key up/down presses, we can let the default handling move the caret. BUG=6437 TEST=See description of 3 scenarios above. Make sure our behavior matches FF's. Also test that password autocomplete still works. Review URL: http://codereview.chromium.org/45067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/editor_client_impl.h')
-rw-r--r--webkit/glue/editor_client_impl.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/webkit/glue/editor_client_impl.h b/webkit/glue/editor_client_impl.h
index 116dfe9..d617fdf 100644
--- a/webkit/glue/editor_client_impl.h
+++ b/webkit/glue/editor_client_impl.h
@@ -129,10 +129,13 @@ class EditorClientImpl : public WebCore::EditorClient {
// 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.
+ // If |requires_caret_at_end| is true, the autofill popup is only shown if the
+ // caret is located at the end of the entered text in |input_element|.
// Returns true if the autofill popup has been scheduled to be shown, false
// otherwise.
bool Autofill(WebCore::HTMLInputElement* input_element,
- bool autofill_on_empty_value);
+ bool autofill_on_empty_value,
+ bool requires_caret_at_end);
// This method is invoked later by Autofill() as when Autofill() is invoked
// (from one of the EditorClient callback) the carret position is not
@@ -140,6 +143,7 @@ class EditorClientImpl : public WebCore::EditorClient {
// to show the autofill popup.
void DoAutofill(WebCore::HTMLInputElement* input_element,
bool autofill_on_empty_value,
+ bool requires_caret_at_end,
bool backspace);
protected: