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

Unified Diff: components/password_manager/core/browser/password_form_manager.h

Issue 1476523004: Implementation of new behaviour of Password Manager on retry password forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments updated Created 5 years, 1 month 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/password_manager/core/browser/password_form_manager.h
diff --git a/components/password_manager/core/browser/password_form_manager.h b/components/password_manager/core/browser/password_form_manager.h
index b46cfe45a4616920663c8234baf3784c8e30fcd8..5d8abc78451fdb923362a9bafc8c7708041ed5dc 100644
--- a/components/password_manager/core/browser/password_form_manager.h
+++ b/components/password_manager/core/browser/password_form_manager.h
@@ -182,6 +182,10 @@ class PasswordFormManager : public PasswordStoreConsumer {
bool password_overridden() const { return password_overridden_; }
+ bool retry_password_form_password_update() const {
+ return retry_password_form_password_update_;
+ }
+
// Called if the user could generate a password for this form.
void MarkGenerationAvailable() { generation_available_ = true; }
@@ -411,6 +415,15 @@ class PasswordFormManager : public PasswordStoreConsumer {
autofill::PasswordForm* FindBestMatchForUpdatePassword(
const base::string16& password) const;
+ // Try to find best matched to |form| from |best_matches_| by the rules:
+ // 1. If there is an element in |best_matches_| with the same username then
+ // return it;
+ // 2. If |form| has no username and there is an element from |best_matches_|
+ // with the same password as in |form| then return it;
+ // 3. Otherwise return nullptr.
+ autofill::PasswordForm* FindBestSavedMatch(
+ const autofill::PasswordForm* form) const;
+
// Set of nonblacklisted PasswordForms from the DB that best match the form
// being managed by this. Use a map instead of vector, because we most
// frequently require lookups by username value in IsNewLogin.
@@ -454,6 +467,10 @@ class PasswordFormManager : public PasswordStoreConsumer {
// Whether the saved password was overridden.
bool password_overridden_;
+ // Whether this submission is considered to be an entering new password on a
vabr (Chromium) 2015/11/26 14:35:54 The comment needs a bit more clarity. "Retry form"
dvadym 2015/11/26 15:19:55 I've changed comment to // A form is considered
+ // retry password form.
+ bool retry_password_form_password_update_;
vabr (Chromium) 2015/11/26 14:35:54 optional nit: You can also use bool retry_passwor
dvadym 2015/11/26 15:19:55 I'll leave as is, since all other variable in this
+
// Whether the user can choose to generate a password for this form.
bool generation_available_;

Powered by Google App Engine
This is Rietveld 408576698