OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_AUTOFILL_FORM_AUTOFILL_UTIL_H_ | 5 #ifndef CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ |
6 #define CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ | 6 #define CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // (3) router configuration pages; and (4) other configuration pages, e.g. for | 45 // (3) router configuration pages; and (4) other configuration pages, e.g. for |
46 // Google code project settings. | 46 // Google code project settings. |
47 extern const size_t kMaxParseableFields; | 47 extern const size_t kMaxParseableFields; |
48 | 48 |
49 // Returns true if |element| is a text input element. | 49 // Returns true if |element| is a text input element. |
50 bool IsTextInput(const WebKit::WebInputElement* element); | 50 bool IsTextInput(const WebKit::WebInputElement* element); |
51 | 51 |
52 // Returns true if |element| is a select element. | 52 // Returns true if |element| is a select element. |
53 bool IsSelectElement(const WebKit::WebFormControlElement& element); | 53 bool IsSelectElement(const WebKit::WebFormControlElement& element); |
54 | 54 |
| 55 // Returns true if |element| is a checkbox or a radio button element. |
| 56 bool IsCheckableElement(const WebKit::WebInputElement* element); |
| 57 |
| 58 // Returns true if |element| is one of the input element that can be autofilled. |
| 59 // {Text, Radiobutton, Checkbox} |
| 60 bool IsAutofillableInputElement(const WebKit::WebInputElement* element); |
| 61 |
55 // Returns the form's |name| attribute if non-empty; otherwise the form's |id| | 62 // Returns the form's |name| attribute if non-empty; otherwise the form's |id| |
56 // attribute. | 63 // attribute. |
57 const string16 GetFormIdentifier(const WebKit::WebFormElement& form); | 64 const string16 GetFormIdentifier(const WebKit::WebFormElement& form); |
58 | 65 |
59 // Fills |autofillable_elements| with all the auto-fillable form control | 66 // Fills |autofillable_elements| with all the auto-fillable form control |
60 // elements in |form_element|. | 67 // elements in |form_element|. |
61 void ExtractAutofillableElements( | 68 void ExtractAutofillableElements( |
62 const WebKit::WebFormElement& form_element, | 69 const WebKit::WebFormElement& form_element, |
63 RequirementsMask requirements, | 70 RequirementsMask requirements, |
64 std::vector<WebKit::WebFormControlElement>* autofillable_elements); | 71 std::vector<WebKit::WebFormControlElement>* autofillable_elements); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // not found. | 122 // not found. |
116 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, | 123 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, |
117 bool was_autofilled); | 124 bool was_autofilled); |
118 | 125 |
119 // Returns true if |form| has any auto-filled fields. | 126 // Returns true if |form| has any auto-filled fields. |
120 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); | 127 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); |
121 | 128 |
122 } // namespace autofill | 129 } // namespace autofill |
123 | 130 |
124 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ | 131 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ |
OLD | NEW |