diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-03 00:30:59 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-03 00:30:59 +0000 |
commit | b143821ab651df119648c0a201b6ab4bf616a500 (patch) | |
tree | bb9946d52d2d1937bbfc3d2de641a0fabca80c3f /chrome/renderer/form_manager.h | |
parent | 89098b14454bd3e9ec38c98084e1e0488de67fb3 (diff) | |
download | chromium_src-b143821ab651df119648c0a201b6ab4bf616a500.zip chromium_src-b143821ab651df119648c0a201b6ab4bf616a500.tar.gz chromium_src-b143821ab651df119648c0a201b6ab4bf616a500.tar.bz2 |
AutoFill: Use the FormManager cache to send forms to the AutoFillManager.
Remove the FormFieldValues class and replace its usage with FormData.
BUG=38325,33032
TEST=none
Review URL: http://codereview.chromium.org/1606005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/form_manager.h')
-rw-r--r-- | chrome/renderer/form_manager.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/chrome/renderer/form_manager.h b/chrome/renderer/form_manager.h index d96e718..28b2d8d 100644 --- a/chrome/renderer/form_manager.h +++ b/chrome/renderer/form_manager.h @@ -46,10 +46,23 @@ class FormManager { void GetForms(RequirementsMask requirements, std::vector<webkit_glue::FormData>* forms); + // Returns a vector of forms in |frame| that match |requirements|. + void GetFormsInFrame(const WebKit::WebFrame* frame, + RequirementsMask requirements, + std::vector<webkit_glue::FormData>* forms); + + // Returns the cached FormData for |element|. Returns true if the form was + // found in the cache. + bool FindForm(const WebKit::WebFormElement& element, + RequirementsMask requirements, + webkit_glue::FormData* form); + // Finds the form that contains |element| and returns it in |form|. Returns // false if the form is not found. - bool FindForm(const WebKit::WebFormControlElement& element, - webkit_glue::FormData* form); + bool FindFormWithFormControlElement( + const WebKit::WebFormControlElement& element, + RequirementsMask requirements, + webkit_glue::FormData* form); // Fills the form represented by |form|. |form| should have the name set to // the name of the form to fill out, and the number of elements and values @@ -78,9 +91,10 @@ class FormManager { typedef std::map<const WebKit::WebFrame*, std::vector<FormElement*> > WebFrameFormElementMap; - // Converts a FormElement to FormData storage. + // Converts a FormElement to FormData storage. Returns false if the form does + // not meet all the requirements in the requirements mask. // TODO(jhawkins): Modify FormElement so we don't need |frame|. - static void FormElementToFormData(const WebKit::WebFrame* frame, + static bool FormElementToFormData(const WebKit::WebFrame* frame, const FormElement* form_element, RequirementsMask requirements, webkit_glue::FormData* form); |