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

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: Don't give up autocompletion completely Created 6 years, 5 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 e7a1126947e5977122ae45dcc81f399e8a093ff9..d70f03648607905484643c4d26f40d742def6afb 100644
--- a/components/autofill/content/renderer/password_autofill_agent.h
+++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -6,6 +6,7 @@
#define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_AUTOFILL_AGENT_H_
#include <map>
+#include <set>
#include <vector>
#include "base/memory/linked_ptr.h"
@@ -91,6 +92,7 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
PasswordInfo() : backspace_pressed_last(false) {}
};
typedef std::map<blink::WebElement, PasswordInfo> LoginToPasswordInfoMap;
+ typedef std::map<blink::WebElement, blink::WebElement> PasswordToLoginMap;
typedef std::map<blink::WebFrame*,
linked_ptr<PasswordForm> > FrameToPasswordFormMap;
@@ -198,6 +200,7 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// The logins we have filled so far with their associated info.
LoginToPasswordInfoMap login_to_password_info_;
+ PasswordToLoginMap password_to_username_;
// Used for UMA stats.
OtherPossibleUsernamesUsage usernames_usage_;
@@ -226,6 +229,12 @@ class PasswordAutofillAgent : public content::RenderViewObserver {
// True indicates that all frames in a page have been rendered.
bool did_stop_loading_;
+ // The set of all username elements, for which the corresponding password
engedy 2014/07/29 14:43:54 As discussed offline, we should just add this to P
vabr (Chromium) 2014/07/29 15:12:30 Done.
+ // fields should not be filled at the moment. This includes cases, where the
+ // user chose a suggestion, then changed the filled password, then entered and
+ // left the username field again without change.
+ std::set<blink::WebElement> temporary_disabled_password_fill_;
+
base::WeakPtrFactory<PasswordAutofillAgent> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PasswordAutofillAgent);

Powered by Google App Engine
This is Rietveld 408576698