OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 const FormData& form_data, | 139 const FormData& form_data, |
140 const blink::WebFormElement& form_element); | 140 const blink::WebFormElement& form_element); |
141 | 141 |
142 // Previews the form represented by |form|. |element| is the input element that | 142 // Previews the form represented by |form|. |element| is the input element that |
143 // initiated the preview process. | 143 // initiated the preview process. |
144 void PreviewForm(const FormData& form, | 144 void PreviewForm(const FormData& form, |
145 const blink::WebFormControlElement& element); | 145 const blink::WebFormControlElement& element); |
146 | 146 |
147 // Clears the placeholder values and the auto-filled background for any fields | 147 // Clears the placeholder values and the auto-filled background for any fields |
148 // in the form containing |node| that have been previewed. Resets the | 148 // in the form containing |node| that have been previewed. Resets the |
149 // autofilled state of |node| to |was_autofilled|. Returns false if the form is | 149 // autofilled state of |node| to |was_autofilled| and password node autofilled |
150 // not found. | 150 // state to |was_password_autofilled|. Returns false if the form is not found. |
151 bool ClearPreviewedFormWithElement(const blink::WebFormControlElement& element, | 151 bool ClearPreviewedFormWithElement(const blink::WebFormControlElement& element, |
152 bool was_autofilled); | 152 bool was_autofilled, |
153 bool was_password_autofilled); | |
Ilya Sherman
2014/05/13 00:44:05
There might be multiple passwords. I think it mig
ziran.sun
2014/05/14 15:35:12
Done.
| |
153 | 154 |
154 // Returns true if |form| has any auto-filled fields. | 155 // Returns true if |form| has any auto-filled fields. |
155 bool FormWithElementIsAutofilled(const blink::WebInputElement& element); | 156 bool FormWithElementIsAutofilled(const blink::WebInputElement& element); |
156 | 157 |
157 // Checks if the webpage is empty. | 158 // Checks if the webpage is empty. |
158 // This kind of webpage is considered as empty: | 159 // This kind of webpage is considered as empty: |
159 // <html> | 160 // <html> |
160 // <head> | 161 // <head> |
161 // <head/> | 162 // <head/> |
162 // <body> | 163 // <body> |
163 // <body/> | 164 // <body/> |
164 // <html/> | 165 // <html/> |
165 // Meta, script and title tags don't influence the emptiness of a webpage. | 166 // Meta, script and title tags don't influence the emptiness of a webpage. |
166 bool IsWebpageEmpty(const blink::WebFrame* frame); | 167 bool IsWebpageEmpty(const blink::WebFrame* frame); |
167 | 168 |
168 // This function checks whether the children of |element| | 169 // This function checks whether the children of |element| |
169 // are of the type <script>, <meta>, or <title>. | 170 // are of the type <script>, <meta>, or <title>. |
170 bool IsWebElementEmpty(const blink::WebElement& element); | 171 bool IsWebElementEmpty(const blink::WebElement& element); |
171 | 172 |
172 // Return a gfx::RectF that is the bounding box for |element| scaled by |scale|. | 173 // Return a gfx::RectF that is the bounding box for |element| scaled by |scale|. |
173 gfx::RectF GetScaledBoundingBox(float scale, | 174 gfx::RectF GetScaledBoundingBox(float scale, |
174 blink::WebFormControlElement* element); | 175 blink::WebFormControlElement* element); |
175 | 176 |
176 } // namespace autofill | 177 } // namespace autofill |
177 | 178 |
178 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ | 179 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_ |
OLD | NEW |