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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 bool FindFormAndFieldForInputElement(const WebKit::WebInputElement& element, | 91 bool FindFormAndFieldForInputElement(const WebKit::WebInputElement& element, |
92 FormData* form, | 92 FormData* form, |
93 FormFieldData* field, | 93 FormFieldData* field, |
94 RequirementsMask requirements); | 94 RequirementsMask requirements); |
95 | 95 |
96 // Fills the form represented by |form|. |element| is the input element that | 96 // Fills the form represented by |form|. |element| is the input element that |
97 // initiated the auto-fill process. | 97 // initiated the auto-fill process. |
98 void FillForm(const FormData& form, | 98 void FillForm(const FormData& form, |
99 const WebKit::WebInputElement& element); | 99 const WebKit::WebInputElement& element); |
100 | 100 |
| 101 void FillFormField(WebKit::WebFormControlElement* field, |
| 102 const FormFieldData* data, |
| 103 bool is_initiating_node); |
| 104 |
101 // Previews the form represented by |form|. |element| is the input element that | 105 // Previews the form represented by |form|. |element| is the input element that |
102 // initiated the preview process. | 106 // initiated the preview process. |
103 void PreviewForm(const FormData& form, | 107 void PreviewForm(const FormData& form, |
104 const WebKit::WebInputElement& element); | 108 const WebKit::WebInputElement& element); |
105 | 109 |
106 // Clears the placeholder values and the auto-filled background for any fields | 110 // Clears the placeholder values and the auto-filled background for any fields |
107 // in the form containing |node| that have been previewed. Resets the | 111 // in the form containing |node| that have been previewed. Resets the |
108 // autofilled state of |node| to |was_autofilled|. Returns false if the form is | 112 // autofilled state of |node| to |was_autofilled|. Returns false if the form is |
109 // not found. | 113 // not found. |
110 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, | 114 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, |
111 bool was_autofilled); | 115 bool was_autofilled); |
112 | 116 |
113 // Returns true if |form| has any auto-filled fields. | 117 // Returns true if |form| has any auto-filled fields. |
114 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); | 118 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); |
115 | 119 |
116 } // namespace autofill | 120 } // namespace autofill |
117 | 121 |
118 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ | 122 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ |
OLD | NEW |