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

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

Issue 1814193002: Better filling on suggestion of password fields in Password Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some fixes Created 4 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 864a075d62af0d5c48226889f339443b18564a10..44dcbca67310a6f8616e902930dd0118d1bbc19a 100644
--- a/components/autofill/content/renderer/password_autofill_agent.h
+++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -47,20 +47,21 @@ class PasswordAutofillAgent : public content::RenderFrameObserver {
// Fills the username and password fields of this form with the given values.
// Returns true if the fields were filled, false otherwise.
- bool FillSuggestion(const blink::WebNode& node,
+ bool FillSuggestion(const blink::WebFormControlElement& node,
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 PreviewSuggestion(const blink::WebNode& node,
+ bool PreviewSuggestion(const blink::WebFormControlElement& node,
const blink::WebString& username,
const blink::WebString& password);
// Clears the preview for the username and password fields, restoring both to
// their previous filled state. Return false if no login information was
// found for the form.
- bool DidClearAutofillSelection(const blink::WebNode& node);
+ bool DidClearAutofillSelection(
+ const blink::WebFormControlElement& control_element);
// Shows an Autofill popup with username suggestions for |element|. If
// |show_all| is |true|, will show all possible suggestions for that element,
@@ -101,9 +102,13 @@ class PasswordAutofillAgent : public content::RenderFrameObserver {
PasswordFormFillData fill_data;
// The user manually edited the password more recently than the username was
// changed.
- bool password_was_edited_last;
+ bool password_was_edited_last = false;
// The user edited the username field after page loading.
- bool username_was_edited;
+ bool username_was_edited = false;
+ // The user accepted a suggestion from a dropdown on a password field.
+ bool password_field_suggestion_was_accepted = false;
+
+ int key;
vabr (Chromium) 2016/04/01 14:07:37 nit: Please explain what kind of key is this.
dvadym 2016/04/07 17:30:20 Done.
PasswordInfo();
};
typedef std::map<blink::WebInputElement, PasswordInfo>
@@ -170,7 +175,7 @@ class PasswordAutofillAgent : public content::RenderFrameObserver {
// username exists, it should be passed as |user_input|. If there is no
// username, pass the password field in |user_input|. In the latter case, no
// username value will be shown in the pop-up.
- bool ShowSuggestionPopup(const PasswordFormFillData& fill_data,
+ bool ShowSuggestionPopup(const PasswordInfo& password_info,
const blink::WebInputElement& user_input,
bool show_all,
bool show_on_password_field);
@@ -182,19 +187,14 @@ class PasswordAutofillAgent : public content::RenderFrameObserver {
// username_element and pasword_info, respectively. Note, that
// |username_element->isNull()| can be true for forms without a username
// field.
- bool FindPasswordInfoForElement(
- const blink::WebInputElement& element,
- const blink::WebInputElement** username_element,
- PasswordInfo** password_info);
+ bool FindPasswordInfoForElement(const blink::WebInputElement& element,
+ blink::WebInputElement* username_element,
+ blink::WebInputElement* password_element,
+ PasswordInfo** password_info);
// Invoked when the frame is closing.
void FrameClosing();
- // Finds login information for a |node| that was previously filled.
- bool FindLoginInfo(const blink::WebNode& node,
- blink::WebInputElement* found_input,
- PasswordInfo** found_password);
-
// Clears the preview for the username and password fields, restoring both to
// their previous filled state.
void ClearPreview(blink::WebInputElement* username,
@@ -214,8 +214,6 @@ class PasswordAutofillAgent : public content::RenderFrameObserver {
// The logins we have filled so far with their associated info.
WebInputToPasswordInfoMap web_input_to_password_info_;
- // And the keys under which PasswordAutofillManager can find the same info.
- WebElementToPasswordInfoKeyMap web_element_to_password_info_key_;
// A (sort-of) reverse map to |login_to_password_info_|.
PasswordToLoginMap password_to_username_;

Powered by Google App Engine
This is Rietveld 408576698