diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-05 09:56:17 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-05 09:56:17 +0000 |
commit | c66ba98c8a1af99da0372d06210ec7f25f078bf3 (patch) | |
tree | c44e1f8d5720455f7eb1b9138b999e65c95156a2 /components/autofill | |
parent | 8ce6a4419d4dd0e744d8ae7a6e5edaa6ed69e8b4 (diff) | |
download | chromium_src-c66ba98c8a1af99da0372d06210ec7f25f078bf3.zip chromium_src-c66ba98c8a1af99da0372d06210ec7f25f078bf3.tar.gz chromium_src-c66ba98c8a1af99da0372d06210ec7f25f078bf3.tar.bz2 |
[Autofill] Give the PasswordAutofillAgent first shot at handling mouse events.
BUG=178313
TEST=(see instructions in bug)
Review URL: https://chromiumcodereview.appspot.com/13601005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/autofill')
-rw-r--r-- | components/autofill/renderer/autofill_agent.cc | 2 | ||||
-rw-r--r-- | components/autofill/renderer/password_autofill_agent.cc | 12 | ||||
-rw-r--r-- | components/autofill/renderer/password_autofill_agent.h | 3 |
3 files changed, 16 insertions, 1 deletions
diff --git a/components/autofill/renderer/autofill_agent.cc b/components/autofill/renderer/autofill_agent.cc index 462b1b6..f32896b 100644 --- a/components/autofill/renderer/autofill_agent.cc +++ b/components/autofill/renderer/autofill_agent.cc @@ -802,6 +802,8 @@ void AutofillAgent::ShowSuggestions(const WebInputElement& element, } element_ = element; + if (password_autofill_agent_->ShowSuggestions(element)) + return; // If autocomplete is disabled at the form level, then we might want to show a // warning in place of suggestions. However, if autocomplete is disabled diff --git a/components/autofill/renderer/password_autofill_agent.cc b/components/autofill/renderer/password_autofill_agent.cc index c76b745..d266757 100644 --- a/components/autofill/renderer/password_autofill_agent.cc +++ b/components/autofill/renderer/password_autofill_agent.cc @@ -334,8 +334,18 @@ bool PasswordAutofillAgent::DidClearAutofillSelection( return FindLoginInfo(node, &input, &password); } +bool PasswordAutofillAgent::ShowSuggestions( + const WebKit::WebInputElement& element) { + LoginToPasswordInfoMap::const_iterator iter = + login_to_password_info_.find(element); + if (iter == login_to_password_info_.end()) + return false; + + return ShowSuggestionPopup(iter->second.fill_data, element); +} + void PasswordAutofillAgent::SendPasswordForms(WebKit::WebFrame* frame, - bool only_visible) { + bool only_visible) { // Make sure that this security origin is allowed to use password manager. WebKit::WebSecurityOrigin origin = frame->document().securityOrigin(); if (!origin.canAccessPasswordManager()) diff --git a/components/autofill/renderer/password_autofill_agent.h b/components/autofill/renderer/password_autofill_agent.h index 1edb581..e2955fd 100644 --- a/components/autofill/renderer/password_autofill_agent.h +++ b/components/autofill/renderer/password_autofill_agent.h @@ -49,6 +49,9 @@ class PasswordAutofillAgent : public content::RenderViewObserver, // cleared when the selection changes. However, this method returns // true when |node| is fillable by password Autofill. bool DidClearAutofillSelection(const WebKit::WebNode& node); + // Shows an Autofill popup with username suggestions for |element|. + // Returns true if any suggestions were shown, false otherwise. + bool ShowSuggestions(const WebKit::WebInputElement& element); private: friend class PasswordAutofillAgentTest; |