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

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

Issue 414013003: Password autofill should not override explicitly typed password (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 6 years, 4 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 b5fc205a04f729538bef11bfaf94368f76ee5078..b6ab805249072b320e82ee9c9fa01dbc0b81acc1 100644
--- a/components/autofill/content/renderer/password_autofill_agent.h
+++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -94,15 +94,19 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
blink::WebInputElement password_field;
PasswordFormFillData fill_data;
bool backspace_pressed_last;
- PasswordInfo() : backspace_pressed_last(false) {}
+ // The user manually edited the password more recently than the username was
+ // changed.
+ bool password_was_edited_last;
+ PasswordInfo();
};
typedef std::map<blink::WebElement, PasswordInfo> LoginToPasswordInfoMap;
+ typedef std::map<blink::WebElement, blink::WebElement> PasswordToLoginMap;
typedef std::map<blink::WebFrame*,
linked_ptr<PasswordForm> > FrameToPasswordFormMap;
- // This class holds a vector of autofilled password input elements and makes
- // sure the autofilled password value is not accessible to JavaScript code
- // until the user interacts with the page.
+ // This class keeps track of autofilled password input elements and makes sure
+ // the autofilled password value is not accessible to JavaScript code until
+ // the user interacts with the page.
class PasswordValueGatekeeper {
public:
PasswordValueGatekeeper();
@@ -190,7 +194,7 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// Finds login information for a |node| that was previously filled.
bool FindLoginInfo(const blink::WebNode& node,
blink::WebInputElement* found_input,
- PasswordInfo* found_password);
+ PasswordInfo** found_password);
// Clears the preview for the username and password fields, restoring both to
// their previous filled state.
@@ -210,6 +214,8 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// The logins we have filled so far with their associated info.
LoginToPasswordInfoMap login_to_password_info_;
+ // A (sort-of) reverse map to |login_to_password_info_|.
+ PasswordToLoginMap password_to_username_;
// Used for UMA stats.
OtherPossibleUsernamesUsage usernames_usage_;

Powered by Google App Engine
This is Rietveld 408576698