OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 18 matching lines...) Expand all Loading... |
29 // | 29 // |
30 // Note: The database stores time in seconds, UTC. | 30 // Note: The database stores time in seconds, UTC. |
31 // | 31 // |
32 // keywords Most of the columns mirror that of a field in | 32 // keywords Most of the columns mirror that of a field in |
33 // TemplateURLData. See that struct for more details. | 33 // TemplateURLData. See that struct for more details. |
34 // id | 34 // id |
35 // short_name | 35 // short_name |
36 // keyword | 36 // keyword |
37 // favicon_url | 37 // favicon_url |
38 // url | 38 // url |
39 // show_in_default_list | |
40 // safe_for_autoreplace | 39 // safe_for_autoreplace |
41 // originating_url | 40 // originating_url |
42 // date_created This column was added after we allowed keywords. | 41 // date_created This column was added after we allowed keywords. |
43 // Keywords created before we started tracking | 42 // Keywords created before we started tracking |
44 // creation date have a value of 0 for this. | 43 // creation date have a value of 0 for this. |
45 // usage_count | 44 // usage_count |
46 // input_encodings Semicolon separated list of supported input | 45 // input_encodings Semicolon separated list of supported input |
47 // encodings, may be empty. | 46 // encodings, may be empty. |
48 // suggest_url | 47 // suggest_url |
49 // prepopulate_id See TemplateURLData::prepopulate_id. | 48 // prepopulate_id See TemplateURLData::prepopulate_id. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 bool SetBuiltinKeywordVersion(int version); | 123 bool SetBuiltinKeywordVersion(int version); |
125 int GetBuiltinKeywordVersion(); | 124 int GetBuiltinKeywordVersion(); |
126 | 125 |
127 // Returns a comma-separated list of the keyword columns for the current | 126 // Returns a comma-separated list of the keyword columns for the current |
128 // version of the table. | 127 // version of the table. |
129 static std::string GetKeywordColumns(); | 128 static std::string GetKeywordColumns(); |
130 | 129 |
131 // Table migration functions. | 130 // Table migration functions. |
132 bool MigrateToVersion53AddNewTabURLColumn(); | 131 bool MigrateToVersion53AddNewTabURLColumn(); |
133 bool MigrateToVersion59RemoveExtensionKeywords(); | 132 bool MigrateToVersion59RemoveExtensionKeywords(); |
| 133 bool MigrateToVersion68RemoveShowInDefaultListColumn(); |
134 | 134 |
135 private: | 135 private: |
136 friend class KeywordTableTest; | 136 friend class KeywordTableTest; |
137 FRIEND_TEST_ALL_PREFIXES(WebDatabaseMigrationTest, MigrateVersion44ToCurrent); | 137 FRIEND_TEST_ALL_PREFIXES(WebDatabaseMigrationTest, MigrateVersion44ToCurrent); |
138 | 138 |
139 // NOTE: Since the table columns have changed in different versions, many | 139 // NOTE: Since the table columns have changed in different versions, many |
140 // functions below take a |table_version| argument which dictates which | 140 // functions below take a |table_version| argument which dictates which |
141 // version number's column set to use. | 141 // version number's column set to use. |
142 | 142 |
143 // Fills |data| with the data in |s|. Returns false if we couldn't fill | 143 // Fills |data| with the data in |s|. Returns false if we couldn't fill |
(...skipping 22 matching lines...) Expand all Loading... |
166 std::string* result); | 166 std::string* result); |
167 | 167 |
168 // Migrates table |name| (which should be either "keywords" or | 168 // Migrates table |name| (which should be either "keywords" or |
169 // "keywords_backup") from version 44 to version 45. | 169 // "keywords_backup") from version 44 to version 45. |
170 bool MigrateKeywordsTableForVersion45(const std::string& name); | 170 bool MigrateKeywordsTableForVersion45(const std::string& name); |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 172 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
173 }; | 173 }; |
174 | 174 |
175 #endif // COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ | 175 #endif // COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ |
OLD | NEW |