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

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: Update code as per Ilya's comment. Created 6 years, 9 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 17ae4831fe58a5aec23fe2598aa329f18ea330f7..630f07bcdecac5324a494856ca2537a2166d39ca 100644
--- a/components/autofill/content/renderer/password_autofill_agent.h
+++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -38,9 +38,14 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
bool TextFieldHandlingKeyDown(const blink::WebInputElement& element,
const blink::WebKeyboardEvent& event);
+ // Preview the password associated with user name |username|. Returns true if
+ // the username and password fields were previewed, false otherwise.
+ bool DidSelectSuggestion(const blink::WebNode& node,
+ const blink::WebString& username);
+
// Fills the password associated with user name |username|. Returns true if
// the username and password fields were filled, false otherwise.
- bool DidAcceptAutofillSuggestion(const blink::WebNode& node,
+ bool DidAcceptSuggestion(const blink::WebNode& node,
const blink::WebString& username);
// A no-op. Password forms are not previewed, so they do not need to be
// cleared when the selection changes. However, this method returns
@@ -49,6 +54,10 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// Shows an Autofill popup with username suggestions for |element|.
// 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();
+ // Return true if password is previewed.
+ bool IsPasswordPreviewed();
// Called when new form controls are inserted.
void OnDynamicFormsSeen(blink::WebFrame* frame);
@@ -146,7 +155,19 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
blink::WebInputElement username_element,
blink::WebInputElement password_element);
- bool FillUserNameAndPassword(
+ void FindUserNameAndPassword(base::string16 current_username,
+ base::string16* username,
+ base::string16* password,
+ const PasswordFormFillData& fill_data,
+ bool exact_username_match);
+
+ bool FillUserNameAndPassword(blink::WebInputElement* username_element,
+ blink::WebInputElement* password_element,
+ const PasswordFormFillData& fill_data,
+ bool exact_username_match,
+ bool set_selection);
+
+ bool PreviewUserNameAndPassword(
blink::WebInputElement* username_element,
blink::WebInputElement* password_element,
const PasswordFormFillData& fill_data,
@@ -189,6 +210,9 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
PasswordValueGatekeeper gatekeeper_;
+ bool was_password_autofilled_;
+ bool is_password_previewed_;
+
base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);

Powered by Google App Engine
This is Rietveld 408576698