diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 19:58:58 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 19:58:58 +0000 |
commit | 013b4d857912c902c725e9f102ee6ca6d3c6b545 (patch) | |
tree | 584a30281bcd6330b1f1d4a9516f3e5d54e27663 /webkit/glue/editor_client_impl.cc | |
parent | 96121f3e85fe5dc2ca05b40328273c53b297f7eb (diff) | |
download | chromium_src-013b4d857912c902c725e9f102ee6ca6d3c6b545.zip chromium_src-013b4d857912c902c725e9f102ee6ca6d3c6b545.tar.gz chromium_src-013b4d857912c902c725e9f102ee6ca6d3c6b545.tar.bz2 |
Create a PasswordAutocompleteListener interface to de-couple WebView
from the password form fill data structures and related classes.
R=yaar
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/332005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29932 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/editor_client_impl.cc')
-rw-r--r-- | webkit/glue/editor_client_impl.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/webkit/glue/editor_client_impl.cc b/webkit/glue/editor_client_impl.cc index a09c9c8..80077ef 100644 --- a/webkit/glue/editor_client_impl.cc +++ b/webkit/glue/editor_client_impl.cc @@ -30,16 +30,16 @@ #include "webkit/api/public/WebViewClient.h" // Can include api/src since eventually editor_client_impl will be there too. #include "webkit/api/src/DOMUtilitiesPrivate.h" +#include "webkit/api/src/PasswordAutocompleteListener.h" #include "webkit/glue/editor_client_impl.h" #include "webkit/glue/form_field_values.h" #include "webkit/glue/glue_util.h" -#include "webkit/glue/password_autocomplete_listener.h" #include "webkit/glue/webview_impl.h" +using WebKit::PasswordAutocompleteListener; using WebKit::WebEditingAction; using WebKit::WebString; using WebKit::WebTextAffinity; -using webkit_glue::FormFieldValues; // Arbitrary depth limit for the undo stack, to keep it from using // unbounded memory. This is the maximum number of distinct undoable @@ -667,12 +667,12 @@ void EditorClientImpl::textFieldDidEndEditing(WebCore::Element* element) { WebFrameImpl* webframe = WebFrameImpl::FromFrame(input_element->document()->frame()); - webkit_glue::PasswordAutocompleteListener* listener = + PasswordAutocompleteListener* listener = webframe->GetPasswordListener(input_element); if (!listener) return; - listener->OnBlur(input_element, input_element->value()); + listener->didBlurInputElement(input_element->value()); } void EditorClientImpl::textDidChangeInTextField(WebCore::Element* element) { @@ -754,14 +754,14 @@ void EditorClientImpl::DoAutofill(WebCore::Timer<EditorClientImpl>* timer) { // a node would be confusing. WebFrameImpl* webframe = WebFrameImpl::FromFrame(input_element->document()->frame()); - webkit_glue::PasswordAutocompleteListener* listener = + PasswordAutocompleteListener* listener = webframe->GetPasswordListener(input_element); if (listener) { if (args->autofill_form_only) return; - listener->OnInlineAutocompleteNeeded( - input_element, value, args->backspace_or_delete_pressed, true); + listener->performInlineAutocomplete( + value, args->backspace_or_delete_pressed, true); return; } @@ -786,14 +786,12 @@ void EditorClientImpl::OnAutofillSuggestionAccepted( WebCore::HTMLInputElement* text_field) { WebFrameImpl* webframe = WebFrameImpl::FromFrame(text_field->document()->frame()); - webkit_glue::PasswordAutocompleteListener* listener = + PasswordAutocompleteListener* listener = webframe->GetPasswordListener(text_field); // Password listeners need to autocomplete other fields that depend on the // input element with autofill suggestions. - if (listener) { - listener->OnInlineAutocompleteNeeded( - text_field, text_field->value(), false, false); - } + if (listener) + listener->performInlineAutocomplete(text_field->value(), false, false); } bool EditorClientImpl::doTextFieldCommandFromEvent( |