Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: components/autofill/content/renderer/form_cache.h

Issue 242613006: [Autofill] Enable Autofill for dynamically created forms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Test fix Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 1f97d073137874e028a4a6e7b00a99eaede33a75..ed7f654654c8140ab78225d8a945345831579880 100644
--- a/components/autofill/content/renderer/form_cache.h
+++ b/components/autofill/content/renderer/form_cache.h
@@ -31,20 +31,10 @@ class FormCache {
FormCache();
~FormCache();
- // Scans the DOM in |frame| extracting and storing forms.
- // Fills |forms| with extracted forms.
- void ExtractForms(const blink::WebFrame& frame,
- std::vector<FormData>* forms);
-
- // Scans the DOM in |frame| extracting and storing forms.
- // Fills |forms| with extracted forms and |web_form_elements| with associated
- // web form elements. Returns true if there are unextracted forms due to
- // |minimum_required_fields| limit, else false.
- bool ExtractFormsAndFormElements(
- const blink::WebFrame& frame,
- size_t minimum_required_fields,
- std::vector<FormData>* forms,
- std::vector<blink::WebFormElement>* web_form_elements);
+ // Scans the DOM in |frame| extracting and storing forms that have not been
+ // seen before. Fills |forms| with extracted forms.
+ void ExtractNewForms(const blink::WebFrame& frame,
+ std::vector<FormData>* forms);
// Resets the forms for the specified |frame|.
void ResetFrame(const blink::WebFrame& frame);
@@ -63,6 +53,9 @@ class FormCache {
// The cached web frames.
std::set<blink::WebDocument> web_documents_;
+ // The cached forms per frame. Used to prevent re-extraction of forms.
+ std::map<const blink::WebFrame*, std::set<FormData> > parsed_forms_;
+
// The cached initial values for <select> elements.
std::map<const blink::WebSelectElement, base::string16>
initial_select_values_;
« no previous file with comments | « components/autofill/content/renderer/autofill_agent.cc ('k') | components/autofill/content/renderer/form_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698