Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: chrome/renderer/autofill/form_autofill_util.h

Issue 11415221: Add support for autofilling radio buttons and checkboxes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: addressed review comments Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // not found. 119 // not found.
110 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, 120 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element,
111 bool was_autofilled); 121 bool was_autofilled);
112 122
113 // Returns true if |form| has any auto-filled fields. 123 // Returns true if |form| has any auto-filled fields.
114 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); 124 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element);
115 125
116 } // namespace autofill 126 } // namespace autofill
117 127
118 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ 128 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698