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

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

Issue 208453002: Add "previewing on hover" support for password field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve rebased code. Created 6 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
Index: components/autofill/content/renderer/password_autofill_agent.h
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h
index 24a7aa9099f7f7e37200b66cc1db11d9f4b64e14..a8310a1e967bf5984a803f13c946136d4858104b 100644
--- a/components/autofill/content/renderer/password_autofill_agent.h
+++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -44,6 +44,12 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
const blink::WebString& username,
const blink::WebString& password);
+ // Previews the username and password fields of this form with the given
+ // values. Returns true if the fields were previewed, false otherwise.
+ bool SelectSuggestion(const blink::WebNode& node,
Ilya Sherman 2014/05/13 00:44:05 nit: Let's name this "PreviewSuggestion".
ziran.sun 2014/05/14 15:35:12 Done.
+ const blink::WebString& username,
+ const blink::WebString& password);
+
// A no-op. Password forms are not previewed, so they do not need to be
// cleared when the selection changes. However, this method returns
// true when |node| is fillable by password Autofill.
@@ -52,6 +58,9 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// Returns true if any suggestions were shown, false otherwise.
bool ShowSuggestions(const blink::WebInputElement& element);
+ // Return true if password was autofilled before previewing the form.
+ bool WasPasswordAutofilled();
Ilya Sherman 2014/05/13 00:44:05 This shouldn't need to be a public method. It sho
ziran.sun 2014/05/14 15:35:12 Done.
+
// Called when new form controls are inserted.
void OnDynamicFormsSeen(blink::WebFrame* frame);
@@ -153,12 +162,11 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
blink::WebInputElement username_element,
blink::WebInputElement password_element);
- bool FillUserNameAndPassword(
- blink::WebInputElement* username_element,
- blink::WebInputElement* password_element,
- const PasswordFormFillData& fill_data,
- bool exact_username_match,
- bool set_selection);
+ bool FillUserNameAndPassword(blink::WebInputElement* username_element,
+ blink::WebInputElement* password_element,
+ const PasswordFormFillData& fill_data,
+ bool exact_username_match,
+ bool set_selection);
// Fills |login_input| and |password| with the most relevant suggestion from
// |fill_data| and shows a popup with other suggestions.
@@ -199,6 +207,12 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// True indicates that user debug information should be logged.
bool logging_state_active_;
+ // True indicates that the password field was autofilled, false otherwise.
+ bool was_password_autofilled_;
+
+ // True indicates that the password field is previewed.
+ bool is_password_previewed_;
Ilya Sherman 2014/05/13 00:44:05 Why is this field necessary?
ziran.sun 2014/05/14 15:35:12 Done.
+
base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);

Powered by Google App Engine
This is Rietveld 408576698