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

Side by Side Diff: chrome/browser/webdata/token_service_table.h

Issue 12543034: Move creation of the various WebDatabaseTable types out of WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows release builds (COMDAT folding combined static functions being used for keys. Created 7 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.cc ('k') | chrome/browser/webdata/token_service_table.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_ 5 #ifndef CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_
6 #define CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_ 6 #define CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "chrome/browser/webdata/web_database_table.h" 12 #include "chrome/browser/webdata/web_database_table.h"
13 13
14 class WebDatabase;
15
14 class TokenServiceTable : public WebDatabaseTable { 16 class TokenServiceTable : public WebDatabaseTable {
15 public: 17 public:
16 TokenServiceTable(sql::Connection* db, sql::MetaTable* meta_table) 18 TokenServiceTable() {}
17 : WebDatabaseTable(db, meta_table) {}
18 virtual ~TokenServiceTable() {} 19 virtual ~TokenServiceTable() {}
19 virtual bool Init() OVERRIDE; 20
21 // Retrieves the TokenServiceTable* owned by |database|.
22 static TokenServiceTable* FromWebDatabase(WebDatabase* db);
23
24 virtual WebDatabaseTable::TypeKey GetTypeKey() const OVERRIDE;
25 virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE;
20 virtual bool IsSyncable() OVERRIDE; 26 virtual bool IsSyncable() OVERRIDE;
21 virtual bool MigrateToVersion(int version, 27 virtual bool MigrateToVersion(int version,
22 const std::string& app_locale, 28 const std::string& app_locale,
23 bool* update_compatible_version) OVERRIDE; 29 bool* update_compatible_version) OVERRIDE;
24 30
25 // Remove all tokens previously set with SetTokenForService. 31 // Remove all tokens previously set with SetTokenForService.
26 bool RemoveAllTokens(); 32 bool RemoveAllTokens();
27 33
28 // Retrieves all tokens previously set with SetTokenForService. 34 // Retrieves all tokens previously set with SetTokenForService.
29 // Returns true if there were tokens and we decrypted them, 35 // Returns true if there were tokens and we decrypted them,
30 // false if there was a failure somehow 36 // false if there was a failure somehow
31 bool GetAllTokens(std::map<std::string, std::string>* tokens); 37 bool GetAllTokens(std::map<std::string, std::string>* tokens);
32 38
33 // Store a token in the token_service table. Stored encrypted. May cause 39 // Store a token in the token_service table. Stored encrypted. May cause
34 // a mac keychain popup. 40 // a mac keychain popup.
35 // True if we encrypted a token and stored it, false otherwise. 41 // True if we encrypted a token and stored it, false otherwise.
36 bool SetTokenForService(const std::string& service, 42 bool SetTokenForService(const std::string& service,
37 const std::string& token); 43 const std::string& token);
38 44
39 private: 45 private:
40 DISALLOW_COPY_AND_ASSIGN(TokenServiceTable); 46 DISALLOW_COPY_AND_ASSIGN(TokenServiceTable);
41 }; 47 };
42 48
43 #endif // CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_ 49 #endif // CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_
OLDNEW
« no previous file with comments | « chrome/browser/webdata/logins_table.cc ('k') | chrome/browser/webdata/token_service_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698