| OLD | NEW |
| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> |
| 10 #include <string> |
| 11 |
| 9 #include "chrome/browser/webdata/web_database_table.h" | 12 #include "chrome/browser/webdata/web_database_table.h" |
| 10 | 13 |
| 11 class TokenServiceTable : public WebDatabaseTable { | 14 class TokenServiceTable : public WebDatabaseTable { |
| 12 public: | 15 public: |
| 13 TokenServiceTable(sql::Connection* db, sql::MetaTable* meta_table) | 16 TokenServiceTable(sql::Connection* db, sql::MetaTable* meta_table) |
| 14 : WebDatabaseTable(db, meta_table) {} | 17 : WebDatabaseTable(db, meta_table) {} |
| 15 virtual ~TokenServiceTable() {} | 18 virtual ~TokenServiceTable() {} |
| 16 virtual bool Init(); | 19 virtual bool Init(); |
| 17 virtual bool IsSyncable(); | 20 virtual bool IsSyncable(); |
| 18 | 21 |
| 19 // Remove all tokens previously set with SetTokenForService. | 22 // Remove all tokens previously set with SetTokenForService. |
| 20 bool RemoveAllTokens(); | 23 bool RemoveAllTokens(); |
| 21 | 24 |
| 22 // Retrieves all tokens previously set with SetTokenForService. | 25 // Retrieves all tokens previously set with SetTokenForService. |
| 23 // Returns true if there were tokens and we decrypted them, | 26 // Returns true if there were tokens and we decrypted them, |
| 24 // false if there was a failure somehow | 27 // false if there was a failure somehow |
| 25 bool GetAllTokens(std::map<std::string, std::string>* tokens); | 28 bool GetAllTokens(std::map<std::string, std::string>* tokens); |
| 26 | 29 |
| 27 // Store a token in the token_service table. Stored encrypted. May cause | 30 // Store a token in the token_service table. Stored encrypted. May cause |
| 28 // a mac keychain popup. | 31 // a mac keychain popup. |
| 29 // True if we encrypted a token and stored it, false otherwise. | 32 // True if we encrypted a token and stored it, false otherwise. |
| 30 bool SetTokenForService(const std::string& service, | 33 bool SetTokenForService(const std::string& service, |
| 31 const std::string& token); | 34 const std::string& token); |
| 32 | 35 |
| 33 private: | 36 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(TokenServiceTable); | 37 DISALLOW_COPY_AND_ASSIGN(TokenServiceTable); |
| 35 }; | 38 }; |
| 36 | 39 |
| 37 | |
| 38 #endif // CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_ | 40 #endif // CHROME_BROWSER_WEBDATA_TOKEN_SERVICE_TABLE_H_ |
| OLD | NEW |