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

Unified Diff: chrome/browser/autofill/form_structure.cc

Issue 11348273: [autofill] Fill in values on a successful run of interactive autocomplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isherman@ review Created 8 years, 1 month 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
Index: chrome/browser/autofill/form_structure.cc
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
index 87c48f07c1eb19f58585f6c88584c1d640212970..dbbacc5dffa388d38d6e61877e3a8e701d90e9cb 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -522,7 +522,7 @@ bool FormStructure::IsAutofillable(bool require_method_post) const {
// TODO(ramankk): Remove this check once we have better way of identifying the
// cases to trigger experimental form filling.
if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalFormFilling))
+ switches::kEnableExperimentalFormFilling))
return true;
if (autofill_count() < kRequiredFillableFields)
@@ -545,7 +545,7 @@ bool FormStructure::ShouldBeParsed(bool require_method_post) const {
// TODO(ramankk): Remove this check once we have better way of identifying the
// cases to trigger experimental form filling.
if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalFormFilling))
+ switches::kEnableExperimentalFormFilling))
return true;
if (field_count() < kRequiredFillableFields)
@@ -814,6 +814,21 @@ std::string FormStructure::server_experiment_id() const {
return server_experiment_id_;
}
+void FormStructure::ToFormData(FormData* out_data) const {
+ // |data->user_submitted| will always be false.
+ scoped_ptr<FormData> data(new FormData);
+ data->name = form_name_;
+ data->origin = source_url_;
+ data->action = target_url_;
+ data->method = method_;
Ilya Sherman 2012/11/29 00:08:59 Why not just directly set the members of |out_data
Dan Beam 2012/11/29 00:51:13 Changed to passing value rather than using out par
+
+ for (size_t i = 0; i < fields_.size(); ++i) {
+ data->fields.push_back(FormFieldData(*fields_[i]));
+ }
+
+ out_data = data.release();
Evan Stade 2012/11/28 22:45:51 this doesn't do anything
Dan Beam 2012/11/29 00:51:13 Thanks for the explanation.
+}
+
bool FormStructure::operator==(const FormData& form) const {
// TODO(jhawkins): Is this enough to differentiate a form?
if (form_name_ == form.name &&

Powered by Google App Engine
This is Rietveld 408576698