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 CHROME_RENDERER_FORM_MANAGER_H_ | 5 #ifndef CHROME_RENDERER_FORM_MANAGER_H_ |
6 #define CHROME_RENDERER_FORM_MANAGER_H_ | 6 #define CHROME_RENDERER_FORM_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // Converts a FormElement to FormData storage. | 73 // Converts a FormElement to FormData storage. |
74 // TODO(jhawkins): Modify FormElement so we don't need |frame|. | 74 // TODO(jhawkins): Modify FormElement so we don't need |frame|. |
75 void FormElementToFormData(WebKit::WebFrame* frame, | 75 void FormElementToFormData(WebKit::WebFrame* frame, |
76 const FormElement* form_element, | 76 const FormElement* form_element, |
77 RequirementsMask requirements, | 77 RequirementsMask requirements, |
78 webkit_glue::FormData* form); | 78 webkit_glue::FormData* form); |
79 | 79 |
80 // Returns the corresponding label for |element|. | 80 // Returns the corresponding label for |element|. |
81 static string16 LabelForElement(const WebKit::WebInputElement& element); | 81 static string16 LabelForElement(const WebKit::WebInputElement& element); |
82 | 82 |
| 83 // Infers corresponding label for |element| from surrounding context in the |
| 84 // DOM. Contents of preceeding <p> tag or preceeding text element found in |
| 85 // the form. |
| 86 static string16 InferLabelForElement(const WebKit::WebInputElement& element); |
| 87 |
83 // The map of form elements. | 88 // The map of form elements. |
84 WebFrameFormElementMap form_elements_map_; | 89 WebFrameFormElementMap form_elements_map_; |
85 | 90 |
86 DISALLOW_COPY_AND_ASSIGN(FormManager); | 91 DISALLOW_COPY_AND_ASSIGN(FormManager); |
87 }; | 92 }; |
88 | 93 |
89 #endif // CHROME_RENDERER_FORM_MANAGER_H_ | 94 #endif // CHROME_RENDERER_FORM_MANAGER_H_ |
OLD | NEW |