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

Unified Diff: chrome/renderer/form_manager.h

Issue 2138005: AutoFill: Preview form field values when the user changes the AutoFill dropdown (Closed)
Patch Set: Rebase. Created 10 years, 7 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
« no previous file with comments | « no previous file | chrome/renderer/form_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/form_manager.h
diff --git a/chrome/renderer/form_manager.h b/chrome/renderer/form_manager.h
index 57ed5af9c257e5b4fbc08f94d7dd5e6b1b6ce4ca..ad4dee73b0ef95bee5487ff9bb6f426c55164fec 100644
--- a/chrome/renderer/form_manager.h
+++ b/chrome/renderer/form_manager.h
@@ -29,7 +29,8 @@ class FormManager {
enum RequirementsMask {
REQUIRE_NONE = 0x0, // No requirements.
REQUIRE_AUTOCOMPLETE = 0x1, // Require that autocomplete != off.
- REQUIRE_ELEMENTS_ENABLED = 0x2 // Require that disabled attribute is off.
+ REQUIRE_ENABLED = 0x2, // Require that disabled attribute is off.
+ REQUIRE_EMPTY = 0x4, // Require that the fields are empty.
};
FormManager();
@@ -91,6 +92,13 @@ class FormManager {
// store multiple forms with the same names from different frames.
bool FillForm(const webkit_glue::FormData& form);
+ // Previews the form represented by |form|. Same conditions as FillForm.
+ bool PreviewForm(const webkit_glue::FormData& form);
+
+ // Clears the placeholder values and the auto-filled background for any fields
+ // in |form| that have been previewed.
+ void ClearPreviewedForm(const webkit_glue::FormData& form);
+
// Fills all of the forms in the cache with form data from |forms|.
void FillForms(const std::vector<webkit_glue::FormData>& forms);
@@ -134,18 +142,27 @@ class FormManager {
bool FindCachedFormElement(const webkit_glue::FormData& form,
FormElement** form_element);
- // For each field in |form| that matches the corresponding field in the cached
- // FormElement, |callback| is called with the actual WebFormControlElement and
- // the FormField data from |form|. This method owns |callback|.
+ // For each field in |data| that matches the corresponding field in |form|
+ // and meets the |requirements|, |callback| is called with the actual
+ // WebFormControlElement and the FormField data from |form|. This method owns
+ // |callback|.
void ForEachMatchingFormField(FormElement* form,
+ RequirementsMask requirements,
const webkit_glue::FormData& data,
Callback* callback);
// A ForEachMatchingFormField() callback that sets |field|'s value using the
- // value in |data|.
+ // value in |data|. This method also sets the autofill attribute, causing the
+ // background to be yellow.
void FillFormField(WebKit::WebFormControlElement* field,
const webkit_glue::FormField* data);
+ // A ForEachMatchingFormField() callback that sets |field|'s placeholder value
+ // using the value in |data|, causing the test to be greyed-out. This method
+ // also sets the autofill attribute, causing the background to be yellow.
+ void PreviewFormField(WebKit::WebFormControlElement* field,
+ const webkit_glue::FormField* data);
+
// The map of form elements.
WebFrameFormElementMap form_elements_map_;
« no previous file with comments | « no previous file | chrome/renderer/form_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698