Chromium Code Reviews| Index: components/autofill/content/renderer/form_cache.h |
| diff --git a/components/autofill/content/renderer/form_cache.h b/components/autofill/content/renderer/form_cache.h |
| index e659492b2e86cd55d7038e36f1f3cfc87e3f7b40..2d18a83dd225f54155e27b61f7a6fbafd3d53143 100644 |
| --- a/components/autofill/content/renderer/form_cache.h |
| +++ b/components/autofill/content/renderer/form_cache.h |
| @@ -10,6 +10,7 @@ |
| #include <vector> |
| #include "base/strings/string16.h" |
| +#include "components/autofill/core/common/form_data.h" |
| namespace blink { |
| class WebDocument; |
| @@ -23,13 +24,12 @@ class WebSelectElement; |
| namespace autofill { |
| -struct FormData; |
| struct FormDataPredictions; |
| -// Manages the forms in a RenderView. |
| +// Manages the forms in a single RenderFrame. |
| class FormCache { |
| public: |
| - FormCache(); |
| + FormCache(const blink::WebFrame& frame); |
|
vabr (Chromium)
2014/12/15 09:30:13
nit: explicit
Evan Stade
2014/12/15 18:41:34
Done.
|
| ~FormCache(); |
| // Get all form control elements from |elements| that are not part of a form. |
| @@ -41,12 +41,12 @@ class FormCache { |
| const blink::WebElementCollection& elements, |
| std::vector<blink::WebElement>* fieldsets); |
| - // Scans the DOM in |frame| extracting and storing forms that have not been |
| + // Scans the DOM in |frame_| extracting and storing forms that have not been |
| // seen before. Returns the extracted forms. |
| - std::vector<FormData> ExtractNewForms(const blink::WebFrame& frame); |
| + std::vector<FormData> ExtractNewForms(); |
| - // Resets the forms for the specified |frame|. |
| - void ResetFrame(const blink::WebFrame& frame); |
| + // Resets the forms. |
| + void Reset(); |
| // Clears the values of all input elements in the form that contains |
| // |element|. Returns false if the form is not found. |
| @@ -67,13 +67,15 @@ class FormCache { |
| const std::vector<blink::WebFormControlElement>& control_elements, |
| bool log_deprecation_messages); |
| - // The cached web frames and their corresponding synthetic FormData. |
| + // The frame this FormCache is associated with. |
| + const blink::WebFrame& frame_; |
| + |
| + // The cached forms. Used to prevent re-extraction of forms. |
| + std::set<FormData> parsed_forms_; |
| + |
| // The synthetic FormData is for all the fieldsets in the document without a |
| // form owner. |
| - std::map<blink::WebDocument, FormData> documents_to_synthetic_form_map_; |
| - |
| - // The cached forms per frame. Used to prevent re-extraction of forms. |
| - std::map<const blink::WebFrame*, std::set<FormData> > parsed_forms_; |
| + FormData synthetic_form_; |
| // The cached initial values for <select> elements. |
| std::map<const blink::WebSelectElement, base::string16> |