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

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

Issue 1734193003: CREDENTIAL: Disable auto sign-in by default for existing credentials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ugh. Created 4 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 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 21 matching lines...) Expand all
32 #include "sql/statement.h" 32 #include "sql/statement.h"
33 #include "sql/transaction.h" 33 #include "sql/transaction.h"
34 #include "url/origin.h" 34 #include "url/origin.h"
35 #include "url/url_constants.h" 35 #include "url/url_constants.h"
36 36
37 using autofill::PasswordForm; 37 using autofill::PasswordForm;
38 38
39 namespace password_manager { 39 namespace password_manager {
40 40
41 // The current version number of the login database schema. 41 // The current version number of the login database schema.
42 const int kCurrentVersionNumber = 16; 42 const int kCurrentVersionNumber = 17;
43 // The oldest version of the schema such that a legacy Chrome client using that 43 // The oldest version of the schema such that a legacy Chrome client using that
44 // version can still read/write the current database. 44 // version can still read/write the current database.
45 const int kCompatibleVersionNumber = 14; 45 const int kCompatibleVersionNumber = 14;
46 46
47 base::Pickle SerializeVector(const std::vector<base::string16>& vec) { 47 base::Pickle SerializeVector(const std::vector<base::string16>& vec) {
48 base::Pickle p; 48 base::Pickle p;
49 for (size_t i = 0; i < vec.size(); ++i) { 49 for (size_t i = 0; i < vec.size(); ++i) {
50 p.WriteString16(vec[i]); 50 p.WriteString16(vec[i]);
51 } 51 }
52 return p; 52 return p;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 case 14: 612 case 14:
613 // No change of schema. Version 15 was introduced to force all databases 613 // No change of schema. Version 15 was introduced to force all databases
614 // through an otherwise no-op migration process that will, however, now 614 // through an otherwise no-op migration process that will, however, now
615 // correctly set the 'compatible version number'. Previously, it was 615 // correctly set the 'compatible version number'. Previously, it was
616 // always being set to (and forever left at) version 1. 616 // always being set to (and forever left at) version 1.
617 meta_table_.SetCompatibleVersionNumber(kCompatibleVersionNumber); 617 meta_table_.SetCompatibleVersionNumber(kCompatibleVersionNumber);
618 case 15: 618 case 15:
619 // Recreate the statistics. 619 // Recreate the statistics.
620 if (!stats_table_.MigrateToVersion(16)) 620 if (!stats_table_.MigrateToVersion(16))
621 return false; 621 return false;
622 case 16: {
623 // No change in scheme: just disable auto sign-in by default in
624 // preparation to launch the credential management API.
625 if (!db_.Execute("UPDATE logins SET skip_zero_click = 1"))
626 return false;
627 // Fall through.
628 }
622 629
623 // ------------------------------------------------------------------------- 630 // -------------------------------------------------------------------------
624 // DO NOT FORGET to update |kCompatibleVersionNumber| if you add a migration 631 // DO NOT FORGET to update |kCompatibleVersionNumber| if you add a migration
625 // step that is a breaking change. This is needed so that an older version 632 // step that is a breaking change. This is needed so that an older version
626 // of the browser can fail with a meaningful error when opening a newer 633 // of the browser can fail with a meaningful error when opening a newer
627 // database, as opposed to failing on the first database operation. 634 // database, as opposed to failing on the first database operation.
628 // ------------------------------------------------------------------------- 635 // -------------------------------------------------------------------------
629 case kCurrentVersionNumber: 636 case kCurrentVersionNumber:
630 // Already up to date. 637 // Already up to date.
631 meta_table_.SetVersionNumber(kCurrentVersionNumber); 638 meta_table_.SetVersionNumber(kCurrentVersionNumber);
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", 1303 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering",
1297 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); 1304 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT);
1298 } 1305 }
1299 1306
1300 if (!statement->Succeeded()) 1307 if (!statement->Succeeded())
1301 return false; 1308 return false;
1302 return true; 1309 return true;
1303 } 1310 }
1304 1311
1305 } // namespace password_manager 1312 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/autofill/core/common/password_form.cc ('k') | components/test/data/password_manager/login_db_v17.sql » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698