| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_AUTOFILL_FORM_H_ | 5 #ifndef WEBKIT_GLUE_AUTOFILL_FORM_H_ |
| 6 #define WEBKIT_GLUE_AUTOFILL_FORM_H_ | 6 #define WEBKIT_GLUE_AUTOFILL_FORM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 namespace WebCore { | 11 namespace WebCore { |
| 12 class HTMLInputElement; |
| 12 class HTMLFormElement; | 13 class HTMLFormElement; |
| 13 } | 14 } |
| 14 | 15 |
| 15 // The AutofillForm struct represents a single HTML form together with the | 16 // The AutofillForm struct represents a single HTML form together with the |
| 16 // values entered in the fields. | 17 // values entered in the fields. |
| 17 | 18 |
| 18 class AutofillForm { | 19 class AutofillForm { |
| 19 public: | 20 public: |
| 20 // Struct for storing name/value pairs. | 21 // Struct for storing name/value pairs. |
| 21 struct Element { | 22 struct Element { |
| 22 Element() {} | 23 Element() {} |
| 23 Element(const std::wstring& in_name, const std::wstring& in_value) { | 24 Element(const std::wstring& in_name, const std::wstring& in_value) { |
| 24 name = in_name; | 25 name = in_name; |
| 25 value = in_value; | 26 value = in_value; |
| 26 } | 27 } |
| 27 std::wstring name; | 28 std::wstring name; |
| 28 std::wstring value; | 29 std::wstring value; |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 static AutofillForm* CreateAutofillForm(WebCore::HTMLFormElement* form); | 32 static AutofillForm* CreateAutofillForm(WebCore::HTMLFormElement* form); |
| 32 | 33 |
| 34 // Returns the name that should be used for the specified |element| when |
| 35 // storing autofill data. This is either the field name or its id, an empty |
| 36 // string if it has no name and no id. |
| 37 static std::wstring GetNameForInputElement(WebCore::HTMLInputElement* |
| 38 element); |
| 39 |
| 33 // A vector of all the input fields in the form. | 40 // A vector of all the input fields in the form. |
| 34 std::vector<Element> elements; | 41 std::vector<Element> elements; |
| 35 }; | 42 }; |
| 36 | 43 |
| 37 #endif // WEBKIT_GLUE_AUTOFILL_FORM_H_ | 44 #endif // WEBKIT_GLUE_AUTOFILL_FORM_H_ |
| OLD | NEW |