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 radio button element. | |
56 bool IsRadioButtonElement(const WebKit::WebInputElement* element); | |
57 | |
58 // Returns true if |element| is a checkbox element | |
59 bool IsCheckboxElement(const WebKit::WebInputElement* element); | |
Ilya Sherman
2012/12/12 00:26:44
Optional nit: Since you always check these two fun
Raman Kakilate
2012/12/12 01:22:04
Done.
| |
60 | |
61 // Returns true if |element| is one of the input element that can be autofilled. | |
62 // {Text, Radiobutton, Checkbox} | |
63 bool IsAutofillableInputElement(const WebKit::WebInputElement* element); | |
64 | |
55 // Returns the form's |name| attribute if non-empty; otherwise the form's |id| | 65 // Returns the form's |name| attribute if non-empty; otherwise the form's |id| |
56 // attribute. | 66 // attribute. |
57 const string16 GetFormIdentifier(const WebKit::WebFormElement& form); | 67 const string16 GetFormIdentifier(const WebKit::WebFormElement& form); |
58 | 68 |
59 // Fills |autofillable_elements| with all the auto-fillable form control | 69 // Fills |autofillable_elements| with all the auto-fillable form control |
60 // elements in |form_element|. | 70 // elements in |form_element|. |
61 void ExtractAutofillableElements( | 71 void ExtractAutofillableElements( |
62 const WebKit::WebFormElement& form_element, | 72 const WebKit::WebFormElement& form_element, |
63 RequirementsMask requirements, | 73 RequirementsMask requirements, |
64 std::vector<WebKit::WebFormControlElement>* autofillable_elements); | 74 std::vector<WebKit::WebFormControlElement>* autofillable_elements); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 // not found. | 125 // not found. |
116 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, | 126 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, |
117 bool was_autofilled); | 127 bool was_autofilled); |
118 | 128 |
119 // Returns true if |form| has any auto-filled fields. | 129 // Returns true if |form| has any auto-filled fields. |
120 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); | 130 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); |
121 | 131 |
122 } // namespace autofill | 132 } // namespace autofill |
123 | 133 |
124 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ | 134 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ |
OLD | NEW |