| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 const WebKit::WebFormElement& form_element, | 78 const WebKit::WebFormElement& form_element, |
| 79 const WebKit::WebFormControlElement& form_control_element, | 79 const WebKit::WebFormControlElement& form_control_element, |
| 80 RequirementsMask requirements, | 80 RequirementsMask requirements, |
| 81 ExtractMask extract_mask, | 81 ExtractMask extract_mask, |
| 82 webkit_glue::FormData* form, | 82 webkit_glue::FormData* form, |
| 83 webkit_glue::FormField* field); | 83 webkit_glue::FormField* field); |
| 84 | 84 |
| 85 // Finds the form that contains |element| and returns it in |form|. Fills | 85 // Finds the form that contains |element| and returns it in |form|. Fills |
| 86 // |field| with the |FormField| representation for element. | 86 // |field| with the |FormField| representation for element. |
| 87 // Returns false if the form is not found. | 87 // Returns false if the form is not found. |
| 88 bool FindFormAndFieldForFormControlElement( | 88 bool FindFormAndFieldForInputElement(const WebKit::WebInputElement& element, |
| 89 const WebKit::WebFormControlElement& element, | 89 webkit_glue::FormData* form, |
| 90 webkit_glue::FormData* form, | 90 webkit_glue::FormField* field, |
| 91 webkit_glue::FormField* field); | 91 RequirementsMask requirements); |
| 92 | 92 |
| 93 // Fills the form represented by |form|. |element| is the input element that | 93 // Fills the form represented by |form|. |element| is the input element that |
| 94 // initiated the auto-fill process. | 94 // initiated the auto-fill process. |
| 95 void FillForm(const webkit_glue::FormData& form, | 95 void FillForm(const webkit_glue::FormData& form, |
| 96 const WebKit::WebInputElement& element); | 96 const WebKit::WebInputElement& element); |
| 97 | 97 |
| 98 // Previews the form represented by |form|. |element| is the input element that | 98 // Previews the form represented by |form|. |element| is the input element that |
| 99 // initiated the preview process. | 99 // initiated the preview process. |
| 100 void PreviewForm(const webkit_glue::FormData& form, | 100 void PreviewForm(const webkit_glue::FormData& form, |
| 101 const WebKit::WebInputElement& element); | 101 const WebKit::WebInputElement& element); |
| 102 | 102 |
| 103 // Clears the placeholder values and the auto-filled background for any fields | 103 // Clears the placeholder values and the auto-filled background for any fields |
| 104 // in the form containing |node| that have been previewed. Resets the | 104 // in the form containing |node| that have been previewed. Resets the |
| 105 // autofilled state of |node| to |was_autofilled|. Returns false if the form is | 105 // autofilled state of |node| to |was_autofilled|. Returns false if the form is |
| 106 // not found. | 106 // not found. |
| 107 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, | 107 bool ClearPreviewedFormWithElement(const WebKit::WebInputElement& element, |
| 108 bool was_autofilled); | 108 bool was_autofilled); |
| 109 | 109 |
| 110 // Returns true if |form| has any auto-filled fields. | 110 // Returns true if |form| has any auto-filled fields. |
| 111 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); | 111 bool FormWithElementIsAutofilled(const WebKit::WebInputElement& element); |
| 112 | 112 |
| 113 } // namespace autofill | 113 } // namespace autofill |
| 114 | 114 |
| 115 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ | 115 #endif // CHROME_RENDERER_AUTOFILL_FORM_AUTOFILL_UTIL_H_ |
| OLD | NEW |