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

Side by Side Diff: components/password_manager/core/browser/login_database.cc

Issue 2132063002: Implement origin-based deletion for password manager's auto-signin bit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/password_manager/core/browser/login_database.h" 5 #include "components/password_manager/core/browser/login_database.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 "password_element, password_value, submit_element, signon_realm, " 1040 "password_element, password_value, submit_element, signon_realm, "
1041 "ssl_valid, preferred, date_created, blacklisted_by_user, " 1041 "ssl_valid, preferred, date_created, blacklisted_by_user, "
1042 "scheme, password_type, possible_usernames, times_used, form_data, " 1042 "scheme, password_type, possible_usernames, times_used, form_data, "
1043 "date_synced, display_name, icon_url, " 1043 "date_synced, display_name, icon_url, "
1044 "federation_url, skip_zero_click, generation_upload_status FROM logins " 1044 "federation_url, skip_zero_click, generation_upload_status FROM logins "
1045 "WHERE skip_zero_click = 0 ORDER BY origin_url")); 1045 "WHERE skip_zero_click = 0 ORDER BY origin_url"));
1046 1046
1047 return StatementToForms(&s, nullptr, forms); 1047 return StatementToForms(&s, nullptr, forms);
1048 } 1048 }
1049 1049
1050 bool LoginDatabase::DisableAutoSignInForAllLogins() { 1050 bool LoginDatabase::DisableAutoSignInForOrigin(const GURL& origin) {
1051 sql::Statement s(db_.GetCachedStatement( 1051 sql::Statement s(db_.GetCachedStatement(
1052 SQL_FROM_HERE, "UPDATE logins SET skip_zero_click = 1;")); 1052 SQL_FROM_HERE,
1053 "UPDATE logins SET skip_zero_click = 1 WHERE origin_url = ?;"));
1054 s.BindString(0, origin.spec());
1053 1055
1054 return s.Run(); 1056 return s.Run();
1055 } 1057 }
1056 1058
1057 // static 1059 // static
1058 LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement( 1060 LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement(
1059 PasswordForm* form, 1061 PasswordForm* form,
1060 sql::Statement& s) { 1062 sql::Statement& s) {
1061 std::string encrypted_password; 1063 std::string encrypted_password;
1062 s.ColumnBlobAsString(COLUMN_PASSWORD_VALUE, &encrypted_password); 1064 s.ColumnBlobAsString(COLUMN_PASSWORD_VALUE, &encrypted_password);
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", 1353 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering",
1352 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); 1354 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT);
1353 } 1355 }
1354 1356
1355 if (!statement->Succeeded()) 1357 if (!statement->Succeeded())
1356 return false; 1358 return false;
1357 return true; 1359 return true;
1358 } 1360 }
1359 1361
1360 } // namespace password_manager 1362 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698