| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 5 #ifndef CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
| 6 #define CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 6 #define CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 static const char kDefaultSearchProviderKey[]; | 86 static const char kDefaultSearchProviderKey[]; |
| 87 // Meta table key to store backup value for the default search provider id. | 87 // Meta table key to store backup value for the default search provider id. |
| 88 static const char kDefaultSearchIDBackupKey[]; | 88 static const char kDefaultSearchIDBackupKey[]; |
| 89 // Meta table key to store backup value signature for the default search | 89 // Meta table key to store backup value signature for the default search |
| 90 // provider. The default search provider ID and the |keywords_backup| table | 90 // provider. The default search provider ID and the |keywords_backup| table |
| 91 // are signed. | 91 // are signed. |
| 92 static const char kBackupSignatureKey[]; | 92 static const char kBackupSignatureKey[]; |
| 93 // Comma-separated list of keyword table column names, in order. | 93 // Comma-separated list of keyword table column names, in order. |
| 94 static const char kKeywordColumns[]; | 94 static const char kKeywordColumns[]; |
| 95 | 95 |
| 96 KeywordTable(sql::Connection* db, sql::MetaTable* meta_table) | 96 KeywordTable(sql::Connection* db, sql::MetaTable* meta_table); |
| 97 : WebDatabaseTable(db, meta_table) {} | |
| 98 virtual ~KeywordTable(); | 97 virtual ~KeywordTable(); |
| 99 virtual bool Init() OVERRIDE; | 98 virtual bool Init() OVERRIDE; |
| 100 virtual bool IsSyncable() OVERRIDE; | 99 virtual bool IsSyncable() OVERRIDE; |
| 101 | 100 |
| 102 // Adds a new keyword, updating the id field on success. | 101 // Adds a new keyword, updating the id field on success. |
| 103 // Returns true if successful. | 102 // Returns true if successful. |
| 104 bool AddKeyword(const TemplateURLData& data); | 103 bool AddKeyword(const TemplateURLData& data); |
| 105 | 104 |
| 106 // Removes the specified keyword. | 105 // Removes the specified keyword. |
| 107 // Returns true if successful. | 106 // Returns true if successful. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 std::string* result); | 191 std::string* result); |
| 193 | 192 |
| 194 // Updates default search provider id backup in |meta| table. Returns | 193 // Updates default search provider id backup in |meta| table. Returns |
| 195 // true on success. The id is returned back via |id| parameter. | 194 // true on success. The id is returned back via |id| parameter. |
| 196 bool UpdateDefaultSearchProviderIDBackup(TemplateURLID* id); | 195 bool UpdateDefaultSearchProviderIDBackup(TemplateURLID* id); |
| 197 | 196 |
| 198 // Migrates table |name| (which should be either "keywords" or | 197 // Migrates table |name| (which should be either "keywords" or |
| 199 // "keywords_backup" from version 44 to version 45. | 198 // "keywords_backup" from version 44 to version 45. |
| 200 bool MigrateKeywordsTableForVersion45(const std::string& name); | 199 bool MigrateKeywordsTableForVersion45(const std::string& name); |
| 201 | 200 |
| 201 // Whether the backup was overwritten during migration. |
| 202 bool backup_overwritten_; |
| 203 |
| 202 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 204 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
| 203 }; | 205 }; |
| 204 | 206 |
| 205 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 207 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
| OLD | NEW |