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_CACHE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 struct FormData; | 26 struct FormData; |
27 struct FormDataPredictions; | 27 struct FormDataPredictions; |
28 | 28 |
29 // Manages the forms in a RenderView. | 29 // Manages the forms in a RenderView. |
30 class FormCache { | 30 class FormCache { |
31 public: | 31 public: |
32 FormCache(); | 32 FormCache(); |
33 ~FormCache(); | 33 ~FormCache(); |
34 | 34 |
35 // Get all form control elements from |elements| that are not part of a form. | |
36 // If |fieldsets| is not NULL, also append the fieldsets encountered that are | |
37 // not part of a form. | |
38 // Exposed for sharing with tests. | |
39 static std::vector<blink::WebFormControlElement> | |
40 GetUnownedAutofillableFormFieldElements( | |
41 const blink::WebElementCollection& elements, | |
42 std::vector<blink::WebElement>* fieldsets); | |
43 | |
44 // Scans the DOM in |frame| extracting and storing forms that have not been | 35 // Scans the DOM in |frame| extracting and storing forms that have not been |
45 // seen before. Returns the extracted forms. | 36 // seen before. Returns the extracted forms. |
46 std::vector<FormData> ExtractNewForms(const blink::WebFrame& frame); | 37 std::vector<FormData> ExtractNewForms(const blink::WebFrame& frame); |
47 | 38 |
48 // Resets the forms for the specified |frame|. | 39 // Resets the forms for the specified |frame|. |
49 void ResetFrame(const blink::WebFrame& frame); | 40 void ResetFrame(const blink::WebFrame& frame); |
50 | 41 |
51 // Clears the values of all input elements in the form that contains | 42 // Clears the values of all input elements in the form that contains |
52 // |element|. Returns false if the form is not found. | 43 // |element|. Returns false if the form is not found. |
53 bool ClearFormWithElement(const blink::WebFormControlElement& element); | 44 bool ClearFormWithElement(const blink::WebFormControlElement& element); |
(...skipping 27 matching lines...) Expand all Loading... |
81 | 72 |
82 // The cached initial values for checkable <input> elements. | 73 // The cached initial values for checkable <input> elements. |
83 std::map<const blink::WebInputElement, bool> initial_checked_state_; | 74 std::map<const blink::WebInputElement, bool> initial_checked_state_; |
84 | 75 |
85 DISALLOW_COPY_AND_ASSIGN(FormCache); | 76 DISALLOW_COPY_AND_ASSIGN(FormCache); |
86 }; | 77 }; |
87 | 78 |
88 } // namespace autofill | 79 } // namespace autofill |
89 | 80 |
90 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ | 81 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_CACHE_H_ |
OLD | NEW |