Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: components/autofill/content/renderer/form_cache.cc

Issue 316853006: Autofill's "Clear Form" should clear only autofilled fields (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated test case Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/autofill/form_autofill_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/form_cache.cc
diff --git a/components/autofill/content/renderer/form_cache.cc b/components/autofill/content/renderer/form_cache.cc
index 716e895e03ac9b3fa4fc65622ab01965ccd8ef13..2b7765d8bd62621aa213b45a5a5335551108ed54 100644
--- a/components/autofill/content/renderer/form_cache.cc
+++ b/components/autofill/content/renderer/form_cache.cc
@@ -177,6 +177,10 @@ bool FormCache::ClearFormWithElement(const WebFormControlElement& element) {
if (!control_element.isEnabled())
continue;
+ // Don't clear field that was not autofilled
+ if (!control_element.isAutofilled())
+ continue;
+
control_element.setAutofilled(false);
WebInputElement* input_element = toWebInputElement(&control_element);
« no previous file with comments | « chrome/renderer/autofill/form_autofill_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698