| 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 HTMLInputElement; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace WebKit { | 15 namespace WebKit { |
| 16 class WebForm; | 16 class WebForm; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace webkit_glue { | 19 namespace webkit_glue { |
| 20 | 20 |
| 21 // The AutofillForm struct represents a single HTML form together with the | 21 // The AutofillForm struct represents a single HTML form together with the |
| 22 // values entered in the fields. | 22 // values entered in the fields. |
| 23 class AutofillForm { | 23 class AutofillForm { |
| 24 public: | 24 public: |
| 25 // Struct for storing name/value pairs. | 25 // Struct for storing name/value pairs. |
| 26 struct Element { | 26 struct Element { |
| 27 Element() {} | 27 Element() {} |
| 28 Element(const std::wstring& in_name, const std::wstring& in_value) { | 28 Element(const string16& in_name, const string16& in_value) { |
| 29 name = in_name; | 29 name = in_name; |
| 30 value = in_value; | 30 value = in_value; |
| 31 } | 31 } |
| 32 std::wstring name; | 32 string16 name; |
| 33 std::wstring value; | 33 string16 value; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 static AutofillForm* Create(const WebKit::WebForm& form); | 36 static AutofillForm* Create(const WebKit::WebForm& form); |
| 37 | 37 |
| 38 // Returns the name that should be used for the specified |element| when | 38 // Returns the name that should be used for the specified |element| when |
| 39 // storing autofill data. This is either the field name or its id, an empty | 39 // storing autofill data. This is either the field name or its id, an empty |
| 40 // string if it has no name and no id. | 40 // string if it has no name and no id. |
| 41 static std::wstring GetNameForInputElement(WebCore::HTMLInputElement* | 41 static string16 GetNameForInputElement(WebCore::HTMLInputElement* |
| 42 element); | 42 element); |
| 43 | 43 |
| 44 // A vector of all the input fields in the form. | 44 // A vector of all the input fields in the form. |
| 45 std::vector<Element> elements; | 45 std::vector<Element> elements; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace webkit_glue | 48 } // namespace webkit_glue |
| 49 | 49 |
| 50 #endif // WEBKIT_GLUE_AUTOFILL_FORM_H_ | 50 #endif // WEBKIT_GLUE_AUTOFILL_FORM_H_ |
| OLD | NEW |