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

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

Issue 355003: Implement FormStructure and an initial method, EncodeUploadRequest. This als... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/autofill/field_types.h ('k') | chrome/browser/autofill/form_structure.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/form_structure.h
===================================================================
--- chrome/browser/autofill/form_structure.h (revision 0)
+++ chrome/browser/autofill/form_structure.h (revision 0)
@@ -0,0 +1,63 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_
+#define CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/scoped_ptr.h"
+#include "chrome/browser/autofill/autofill_field.h"
+#include "googleurl/src/gurl.h"
+
+namespace webkit_glue {
+class FormFieldValues;
+}
+
+enum RequestMethod {
+ GET,
+ POST
+};
+
+// FormStructure stores a single HTML form together with the values entered
+// in the fields along with additional information needed by AutoFill.
+class FormStructure {
+ public:
+ explicit FormStructure(const webkit_glue::FormFieldValues& values);
+
+ // Encodes the XML upload request from this FormStructure.
+ bool EncodeUploadRequest(bool auto_fill_used, std::string* encoded_xml) const;
+
+ // The unique signature for this form, composed of the target url domain,
+ // the form name, and the form field names in a 64-bit hash.
+ std::string FormSignature() const;
+
+ // Runs a quick heuristic to rule out pages but obviously not auto-fillable,
+ // like google/yahoo/msn search, etc.
+ bool IsAutoFillable() const;
+
+ private:
+ // The name of the form.
+ std::string form_name_;
+
+ // The source URL.
+ GURL source_url_;
+
+ // The target URL.
+ GURL target_url_;
+
+ // A vector of all the input fields in the form.
+ std::vector<AutoFillField> fields_;
+
+ // The names of the form input elements, that are part of the form signature.
+ // The string starts with "&" and the names are also separated by the "&"
+ // character. E.g.: "&form_input1_name&form_input2_name&...&form_inputN_name"
+ std::string form_signature_field_names_;
+
+ // GET or POST.
+ RequestMethod method_;
+};
+
+#endif // CHROME_BROWSER_AUTOFILL_FORM_STRUCTURE_H_
Property changes on: chrome/browser/autofill/form_structure.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/autofill/field_types.h ('k') | chrome/browser/autofill/form_structure.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698