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

Side by Side Diff: chrome/browser/webdata/logins_table.cc

Issue 207643002: Create new Autofill tables as part of DB migration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/webdata/logins_table.h ('k') | chrome/browser/webdata/web_apps_table.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/webdata/logins_table.h" 5 #include "chrome/browser/webdata/logins_table.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "components/webdata/common/web_database.h" 10 #include "components/webdata/common/web_database.h"
(...skipping 11 matching lines...) Expand all
22 } // namespace 22 } // namespace
23 23
24 LoginsTable* LoginsTable::FromWebDatabase(WebDatabase* db) { 24 LoginsTable* LoginsTable::FromWebDatabase(WebDatabase* db) {
25 return static_cast<LoginsTable*>(db->GetTable(GetKey())); 25 return static_cast<LoginsTable*>(db->GetTable(GetKey()));
26 } 26 }
27 27
28 WebDatabaseTable::TypeKey LoginsTable::GetTypeKey() const { 28 WebDatabaseTable::TypeKey LoginsTable::GetTypeKey() const {
29 return GetKey(); 29 return GetKey();
30 } 30 }
31 31
32 bool LoginsTable::Init(sql::Connection* db, sql::MetaTable* meta_table) { 32 bool LoginsTable::CreateTablesIfNecessary() {
33 WebDatabaseTable::Init(db, meta_table);
34
35 if (db_->DoesTableExist("logins")) { 33 if (db_->DoesTableExist("logins")) {
36 // We don't check for success. It doesn't matter that much. 34 // We don't check for success. It doesn't matter that much.
37 // If we fail we'll just try again later anyway. 35 // If we fail we'll just try again later anyway.
38 ignore_result(db_->Execute("DROP TABLE logins")); 36 ignore_result(db_->Execute("DROP TABLE logins"));
39 } 37 }
40 38
41 #if defined(OS_WIN) 39 #if defined(OS_WIN)
42 if (!db_->DoesTableExist("ie7_logins")) { 40 if (!db_->DoesTableExist("ie7_logins")) {
43 if (!db_->Execute("CREATE TABLE ie7_logins (" 41 if (!db_->Execute("CREATE TABLE ie7_logins ("
44 "url_hash VARCHAR NOT NULL, " 42 "url_hash VARCHAR NOT NULL, "
(...skipping 16 matching lines...) Expand all
61 } 59 }
62 60
63 bool LoginsTable::IsSyncable() { 61 bool LoginsTable::IsSyncable() {
64 return true; 62 return true;
65 } 63 }
66 64
67 bool LoginsTable::MigrateToVersion(int version, 65 bool LoginsTable::MigrateToVersion(int version,
68 bool* update_compatible_version) { 66 bool* update_compatible_version) {
69 return true; 67 return true;
70 } 68 }
OLDNEW
« no previous file with comments | « chrome/browser/webdata/logins_table.h ('k') | chrome/browser/webdata/web_apps_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698