| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_GLUE_FORM_DATA_H__ | 5 #ifndef WEBKIT_GLUE_FORM_DATA_H__ |
| 6 #define WEBKIT_GLUE_FORM_DATA_H__ | 6 #define WEBKIT_GLUE_FORM_DATA_H__ |
| 7 | 7 |
| 8 #include <string> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/string_util.h" | 11 #include "base/string16.h" |
| 11 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 12 #include "webkit/glue/form_field.h" | 13 #include "webkit/glue/form_field.h" |
| 13 | 14 |
| 14 namespace webkit_glue { | 15 namespace webkit_glue { |
| 15 | 16 |
| 16 // Holds information about a form to be filled and/or submitted. | 17 // Holds information about a form to be filled and/or submitted. |
| 17 struct FormData { | 18 struct FormData { |
| 18 // The name of the form. | 19 // The name of the form. |
| 19 string16 name; | 20 string16 name; |
| 20 // GET or POST. | 21 // GET or POST. |
| 21 string16 method; | 22 string16 method; |
| 22 // The URL (minus query parameters) containing the form. | 23 // The URL (minus query parameters) containing the form. |
| 23 GURL origin; | 24 GURL origin; |
| 24 // The action target of the form. | 25 // The action target of the form. |
| 25 GURL action; | 26 GURL action; |
| 27 // The locale of the form, according to the DOM. |
| 28 std::string locale; |
| 26 // true if this form was submitted by a user gesture and not javascript. | 29 // true if this form was submitted by a user gesture and not javascript. |
| 27 bool user_submitted; | 30 bool user_submitted; |
| 28 // A vector of all the input fields in the form. | 31 // A vector of all the input fields in the form. |
| 29 std::vector<FormField> fields; | 32 std::vector<FormField> fields; |
| 30 | 33 |
| 31 FormData(); | 34 FormData(); |
| 32 FormData(const FormData& data); | 35 FormData(const FormData& data); |
| 33 ~FormData(); | 36 ~FormData(); |
| 34 | 37 |
| 35 // Used by FormStructureTest. | 38 // Used by FormStructureTest. |
| 36 bool operator==(const FormData& form) const; | 39 bool operator==(const FormData& form) const; |
| 37 }; | 40 }; |
| 38 | 41 |
| 39 } // namespace webkit_glue | 42 } // namespace webkit_glue |
| 40 | 43 |
| 41 #endif // WEBKIT_GLUE_FORM_DATA_H__ | 44 #endif // WEBKIT_GLUE_FORM_DATA_H__ |
| OLD | NEW |