diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 00:17:54 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 00:17:54 +0000 |
commit | 97652631f65b357867d01ffe260d5b488002b190 (patch) | |
tree | 8a5cf7344a5e1098d727a161b2f89ac410be8be2 /webkit | |
parent | 621b839059834c68966e0bf6bfa305eb522c0e0a (diff) | |
download | chromium_src-97652631f65b357867d01ffe260d5b488002b190.zip chromium_src-97652631f65b357867d01ffe260d5b488002b190.tar.gz chromium_src-97652631f65b357867d01ffe260d5b488002b190.tar.bz2 |
Adding a new showSuggestionPopup to the the WebPasswordAutocompleteListenerImpl
class
Adding a new showSuggestionPopup to the the WebPasswordAutocompleteListenerImpl class as it will be added soon to the WebPasswordAutocompleteListener interface as part of the WebKit change: https://bugs.webkit.org/show_bug.cgi?id=40464
Original review: http://codereview.chromium.org/2819002
BUG=38283
TEST=None
Fix for a translate related crasher. When a page was closed, a pending task on the TranslationHelper was accessing the WebView that would be NULL.
BUG=46584
TEST=None
Review URL: http://codereview.chromium.org/2845008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webpasswordautocompletelistener_impl.cc | 19 | ||||
-rw-r--r-- | webkit/glue/webpasswordautocompletelistener_impl.h | 1 |
2 files changed, 14 insertions, 6 deletions
diff --git a/webkit/glue/webpasswordautocompletelistener_impl.cc b/webkit/glue/webpasswordautocompletelistener_impl.cc index f082f1f..8791c80 100644 --- a/webkit/glue/webpasswordautocompletelistener_impl.cc +++ b/webkit/glue/webpasswordautocompletelistener_impl.cc @@ -62,7 +62,6 @@ void WebInputElementDelegate::RefreshAutofillPopup( default_suggestion_index); } - WebPasswordAutocompleteListenerImpl::WebPasswordAutocompleteListenerImpl( WebInputElementDelegate* username_delegate, WebInputElementDelegate* password_delegate, @@ -117,11 +116,8 @@ void WebPasswordAutocompleteListenerImpl::performInlineAutocomplete( password_delegate_->SetAutofilled(false); } - if (show_suggestions) { - std::vector<string16> suggestions; - GetSuggestions(user_input16, &suggestions); - username_delegate_->RefreshAutofillPopup(suggestions, -1); - } + if (show_suggestions) + showSuggestionPopup(user_input16); if (backspace_or_delete_pressed) return; // Don't inline autocomplete when the user deleted something. @@ -148,6 +144,17 @@ void WebPasswordAutocompleteListenerImpl::performInlineAutocomplete( } } +bool WebPasswordAutocompleteListenerImpl::showSuggestionPopup( + const WebString& value) { + std::vector<string16> suggestions; + GetSuggestions(value, &suggestions); + if (suggestions.empty()) + return false; + + username_delegate_->RefreshAutofillPopup(suggestions, -1); + return true; +} + bool WebPasswordAutocompleteListenerImpl::TryToMatch(const string16& input, const string16& username, const string16& password) { diff --git a/webkit/glue/webpasswordautocompletelistener_impl.h b/webkit/glue/webpasswordautocompletelistener_impl.h index 1736d43..0c37b89e 100644 --- a/webkit/glue/webpasswordautocompletelistener_impl.h +++ b/webkit/glue/webpasswordautocompletelistener_impl.h @@ -59,6 +59,7 @@ class WebPasswordAutocompleteListenerImpl : virtual void performInlineAutocomplete(const WebString& user_input, bool backspace_or_delete_pressed, bool show_suggestions); + virtual bool showSuggestionPopup(const WebString& value); private: // Check if the input string resembles a potential matching login |