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

Unified Diff: components/password_manager/core/browser/login_database.cc

Issue 169173005: Update incomplete credentials in Login Database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compilation fix for newer master Created 6 years, 10 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/password_manager/core/browser/login_database.cc
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc
index 54cd3613713aa721e65a98fc53266d09e3746821..8b895058c995d71050d252244ee741bafd5e9604 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -295,11 +295,14 @@ bool LoginDatabase::UpdateLogin(const PasswordForm& form, int* items_changed) {
"preferred = ?, "
"possible_usernames = ?, "
"times_used = ?, "
- "use_additional_auth = ? "
+ "username_element = ?, "
+ "password_element = ?, "
+ "submit_element = ? "
"WHERE origin_url = ? AND "
- "username_element = ? AND "
+ "(username_element = ? OR username_element = '') AND "
"username_value = ? AND "
- "password_element = ? AND "
+ "(password_element = ? OR password_element = '') AND "
+ "(submit_element = ? OR submit_element = '') AND "
"signon_realm = ?"));
s.BindString(0, form.action.spec());
s.BindBlob(1, encrypted_password.data(),
@@ -309,12 +312,16 @@ bool LoginDatabase::UpdateLogin(const PasswordForm& form, int* items_changed) {
Pickle pickle = SerializeVector(form.other_possible_usernames);
s.BindBlob(4, pickle.data(), pickle.size());
s.BindInt(5, form.times_used);
- s.BindInt(6, form.use_additional_authentication);
- s.BindString(7, form.origin.spec());
- s.BindString16(8, form.username_element);
- s.BindString16(9, form.username_value);
- s.BindString16(10, form.password_element);
- s.BindString(11, form.signon_realm);
+ s.BindString16(6, form.username_element);
+ s.BindString16(7, form.password_element);
+ s.BindString16(8, form.submit_element);
+
+ s.BindString(9, form.origin.spec());
+ s.BindString16(10, form.username_element);
+ s.BindString16(11, form.username_value);
+ s.BindString16(12, form.password_element);
+ s.BindString16(13, form.submit_element);
+ s.BindString(14, form.signon_realm);
if (!s.Run())
return false;

Powered by Google App Engine
This is Rietveld 408576698