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

Unified Diff: chrome/renderer/autofill/form_manager.cc

Issue 7602006: Add preliminary Autofill support for the 'autocompletetype' attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Prevent DOS Created 9 years, 4 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/common/autofill_messages.h ('k') | chrome/renderer/autofill/form_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/autofill/form_manager.cc
diff --git a/chrome/renderer/autofill/form_manager.cc b/chrome/renderer/autofill/form_manager.cc
index e33ef38871d1039404a520e68cd5b56f3db99d21..3465f93171628cbc125d76a9f49628fc02081b14 100644
--- a/chrome/renderer/autofill/form_manager.cc
+++ b/chrome/renderer/autofill/form_manager.cc
@@ -598,6 +598,14 @@ void FormManager::WebFormControlElementToFormField(
// WebFormElementToFormData.
field->name = element.nameForAutofill();
field->form_control_type = element.formControlType();
+ field->autocomplete_type = element.getAttribute("x-autocompletetype");
+ TrimWhitespace(field->autocomplete_type, TRIM_ALL, &field->autocomplete_type);
+ if (field->autocomplete_type.size() > kMaxDataLength) {
+ // Discard overly long attribute values to avoid DOS-ing the browser
+ // process. However, send over a default string to indicate that the
+ // attribute was present.
+ field->autocomplete_type = ASCIIToUTF16("x-max-data-length-exceeded");
+ }
if (!IsAutofillableElement(element))
return;
« no previous file with comments | « chrome/common/autofill_messages.h ('k') | chrome/renderer/autofill/form_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698