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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 // Version of the built-in keywords. | 120 // Version of the built-in keywords. |
121 bool SetBuiltinKeywordVersion(int version); | 121 bool SetBuiltinKeywordVersion(int version); |
122 int GetBuiltinKeywordVersion(); | 122 int GetBuiltinKeywordVersion(); |
123 | 123 |
124 // Returns a comma-separated list of the keyword columns for the current | 124 // Returns a comma-separated list of the keyword columns for the current |
125 // version of the table. | 125 // version of the table. |
126 static std::string GetKeywordColumns(); | 126 static std::string GetKeywordColumns(); |
127 | 127 |
128 // Table migration functions. | 128 // Table migration functions. |
129 bool MigrateToVersion21AutoGenerateKeywordColumn(); | |
130 bool MigrateToVersion25AddLogoIDColumn(); | |
131 bool MigrateToVersion26AddCreatedByPolicyColumn(); | |
132 bool MigrateToVersion28SupportsInstantColumn(); | |
133 bool MigrateToVersion29InstantURLToSupportsInstant(); | |
134 bool MigrateToVersion38AddLastModifiedColumn(); | |
135 bool MigrateToVersion39AddSyncGUIDColumn(); | |
136 bool MigrateToVersion44AddDefaultSearchProviderBackup(); | |
137 bool MigrateToVersion45RemoveLogoIDAndAutogenerateColumns(); | |
138 bool MigrateToVersion47AddAlternateURLsColumn(); | |
139 bool MigrateToVersion48RemoveKeywordsBackup(); | |
140 bool MigrateToVersion49AddSearchTermsReplacementKeyColumn(); | |
141 bool MigrateToVersion52AddImageSearchAndPOSTSupport(); | |
142 bool MigrateToVersion53AddNewTabURLColumn(); | 129 bool MigrateToVersion53AddNewTabURLColumn(); |
143 bool MigrateToVersion59RemoveExtensionKeywords(); | 130 bool MigrateToVersion59RemoveExtensionKeywords(); |
144 | 131 |
145 private: | 132 private: |
146 friend class KeywordTableTest; | 133 friend class KeywordTableTest; |
147 FRIEND_TEST_ALL_PREFIXES(WebDatabaseMigrationTest, MigrateVersion44ToCurrent); | 134 FRIEND_TEST_ALL_PREFIXES(WebDatabaseMigrationTest, MigrateVersion44ToCurrent); |
148 | 135 |
149 // NOTE: Since the table columns have changed in different versions, many | 136 // NOTE: Since the table columns have changed in different versions, many |
150 // functions below take a |table_version| argument which dictates which | 137 // functions below take a |table_version| argument which dictates which |
151 // version number's column set to use. | 138 // version number's column set to use. |
(...skipping 24 matching lines...) Expand all Loading... |
176 std::string* result); | 163 std::string* result); |
177 | 164 |
178 // Migrates table |name| (which should be either "keywords" or | 165 // Migrates table |name| (which should be either "keywords" or |
179 // "keywords_backup") from version 44 to version 45. | 166 // "keywords_backup") from version 44 to version 45. |
180 bool MigrateKeywordsTableForVersion45(const std::string& name); | 167 bool MigrateKeywordsTableForVersion45(const std::string& name); |
181 | 168 |
182 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 169 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
183 }; | 170 }; |
184 | 171 |
185 #endif // COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ | 172 #endif // COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ |
OLD | NEW |