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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_WEBDATA_LOGINS_TABLE_H_
6 #define CHROME_BROWSER_WEBDATA_LOGINS_TABLE_H_
10 #include "base/compiler_specific.h"
11 #include "components/webdata/common/web_database_table.h"
14 struct IE7PasswordInfo
;
19 // This class manages the logins table within the SQLite database passed to the
20 // constructor. We no longer store passwords here except for imported IE
21 // passwords, so this class is now mostly responsible for deleting the table if
22 // it is found to exist. (The data was migrated out long ago.)
23 class LoginsTable
: public WebDatabaseTable
{
26 virtual ~LoginsTable() {}
28 // Retrieves the LoginsTable* owned by |database|.
29 static LoginsTable
* FromWebDatabase(WebDatabase
* db
);
31 virtual WebDatabaseTable::TypeKey
GetTypeKey() const OVERRIDE
;
32 virtual bool Init(sql::Connection
* db
, sql::MetaTable
* meta_table
) OVERRIDE
;
33 virtual bool IsSyncable() OVERRIDE
;
34 virtual bool MigrateToVersion(int version
,
35 bool* update_compatible_version
) OVERRIDE
;
38 // Adds |info| to the list of imported passwords from ie7/ie8.
39 bool AddIE7Login(const IE7PasswordInfo
& info
);
41 // Removes |info| from the list of imported passwords from ie7/ie8.
42 bool RemoveIE7Login(const IE7PasswordInfo
& info
);
44 // Return the ie7/ie8 login matching |info|.
45 bool GetIE7Login(const IE7PasswordInfo
& info
, IE7PasswordInfo
* result
);
49 DISALLOW_COPY_AND_ASSIGN(LoginsTable
);
52 #endif // CHROME_BROWSER_WEBDATA_LOGINS_TABLE_H_