summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 02:10:21 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 02:10:21 +0000
commit6075d0503672122dfb761259b0dcacafe90c5770 (patch)
tree28182f86cacb7a91bea2499800c5a4a84ff08219
parente4014bb7b80eba94314a9929643a0a2acd4f53b8 (diff)
downloadchromium_src-6075d0503672122dfb761259b0dcacafe90c5770.zip
chromium_src-6075d0503672122dfb761259b0dcacafe90c5770.tar.gz
chromium_src-6075d0503672122dfb761259b0dcacafe90c5770.tar.bz2
Fix crash that occurs when users with Password Autofill data try to log in to websites.
BUG=96321 TEST=none Review URL: http://codereview.chromium.org/7879002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100840 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/autofill/autofill_agent.cc3
-rw-r--r--chrome/renderer/autofill/password_autofill_manager.cc7
-rw-r--r--chrome/renderer/autofill/password_autofill_manager.h4
3 files changed, 14 insertions, 0 deletions
diff --git a/chrome/renderer/autofill/autofill_agent.cc b/chrome/renderer/autofill/autofill_agent.cc
index d18d9b4..2c95945 100644
--- a/chrome/renderer/autofill/autofill_agent.cc
+++ b/chrome/renderer/autofill/autofill_agent.cc
@@ -170,6 +170,9 @@ void AutofillAgent::didSelectAutofillSuggestion(const WebNode& node,
}
void AutofillAgent::didClearAutofillSelection(const WebNode& node) {
+ if (password_autofill_manager_->DidClearAutofillSelection(node))
+ return;
+
DCHECK(node == autofill_query_element_);
FormManager::ClearPreviewedFormWithElement(autofill_query_element_,
was_query_node_autofilled_);
diff --git a/chrome/renderer/autofill/password_autofill_manager.cc b/chrome/renderer/autofill/password_autofill_manager.cc
index d2954cc..10c74bd 100644
--- a/chrome/renderer/autofill/password_autofill_manager.cc
+++ b/chrome/renderer/autofill/password_autofill_manager.cc
@@ -322,6 +322,13 @@ bool PasswordAutofillManager::DidSelectAutofillSuggestion(
return FindLoginInfo(node, &input, &password);
}
+bool PasswordAutofillManager::DidClearAutofillSelection(
+ const WebKit::WebNode& node) {
+ WebKit::WebInputElement input;
+ PasswordInfo password;
+ return FindLoginInfo(node, &input, &password);
+}
+
void PasswordAutofillManager::SendPasswordForms(WebKit::WebFrame* frame,
bool only_visible) {
// Make sure that this security origin is allowed to use password manager.
diff --git a/chrome/renderer/autofill/password_autofill_manager.h b/chrome/renderer/autofill/password_autofill_manager.h
index eb671e1..34bae2d 100644
--- a/chrome/renderer/autofill/password_autofill_manager.h
+++ b/chrome/renderer/autofill/password_autofill_manager.h
@@ -45,6 +45,10 @@ class PasswordAutofillManager : public RenderViewObserver,
// A no-op. No filling happens for selection. But this method returns
// true when |node| is fillable by password Autofill.
bool DidSelectAutofillSuggestion(const WebKit::WebNode& node);
+ // A no-op. Password forms are not previewed, so they do not need to be
+ // cleared when the selection changes. However, this method returns
+ // true when |node| is fillable by password Autofill.
+ bool DidClearAutofillSelection(const WebKit::WebNode& node);
private:
friend class PasswordAutofillManagerTest;