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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // created_by_policy See TemplateURLData::created_by_policy. This was | 46 // created_by_policy See TemplateURLData::created_by_policy. This was |
47 // added in version 26. | 47 // added in version 26. |
48 // instant_url See TemplateURLData::instant_url. This was added in | 48 // instant_url See TemplateURLData::instant_url. This was added in |
49 // version 29. | 49 // version 29. |
50 // last_modified See TemplateURLData::last_modified. This was added | 50 // last_modified See TemplateURLData::last_modified. This was added |
51 // in version 38. | 51 // in version 38. |
52 // sync_guid See TemplateURLData::sync_guid. This was added in | 52 // sync_guid See TemplateURLData::sync_guid. This was added in |
53 // version 39. | 53 // version 39. |
54 // alternate_urls See TemplateURLData::alternate_urls. This was added | 54 // alternate_urls See TemplateURLData::alternate_urls. This was added |
55 // in version 47. | 55 // in version 47. |
| 56 // search_terms_replacement_key |
| 57 // See TemplateURLData::search_terms_replacement_key. |
| 58 // This was added in version 49. |
| 59 // |
56 // | 60 // |
57 // This class also manages some fields in the |meta| table: | 61 // This class also manages some fields in the |meta| table: |
58 // | 62 // |
59 // Default Search Provider ID The id of the default search provider. | 63 // Default Search Provider ID The id of the default search provider. |
60 // Builtin Keyword Version The version of builtin keywords data. | 64 // Builtin Keyword Version The version of builtin keywords data. |
61 // | 65 // |
62 class KeywordTable : public WebDatabaseTable { | 66 class KeywordTable : public WebDatabaseTable { |
63 public: | 67 public: |
64 typedef std::vector<TemplateURLData> Keywords; | 68 typedef std::vector<TemplateURLData> Keywords; |
65 | 69 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bool MigrateToVersion25AddLogoIDColumn(); | 110 bool MigrateToVersion25AddLogoIDColumn(); |
107 bool MigrateToVersion26AddCreatedByPolicyColumn(); | 111 bool MigrateToVersion26AddCreatedByPolicyColumn(); |
108 bool MigrateToVersion28SupportsInstantColumn(); | 112 bool MigrateToVersion28SupportsInstantColumn(); |
109 bool MigrateToVersion29InstantURLToSupportsInstant(); | 113 bool MigrateToVersion29InstantURLToSupportsInstant(); |
110 bool MigrateToVersion38AddLastModifiedColumn(); | 114 bool MigrateToVersion38AddLastModifiedColumn(); |
111 bool MigrateToVersion39AddSyncGUIDColumn(); | 115 bool MigrateToVersion39AddSyncGUIDColumn(); |
112 bool MigrateToVersion44AddDefaultSearchProviderBackup(); | 116 bool MigrateToVersion44AddDefaultSearchProviderBackup(); |
113 bool MigrateToVersion45RemoveLogoIDAndAutogenerateColumns(); | 117 bool MigrateToVersion45RemoveLogoIDAndAutogenerateColumns(); |
114 bool MigrateToVersion47AddAlternateURLsColumn(); | 118 bool MigrateToVersion47AddAlternateURLsColumn(); |
115 bool MigrateToVersion48RemoveKeywordsBackup(); | 119 bool MigrateToVersion48RemoveKeywordsBackup(); |
| 120 bool MigrateToVersion49AddSearchTermsReplacementKeyColumn(); |
116 | 121 |
117 private: | 122 private: |
118 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, GetTableContents); | 123 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, GetTableContents); |
119 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, GetTableContentsOrdering); | 124 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, GetTableContentsOrdering); |
120 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, SanitizeURLs); | 125 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, SanitizeURLs); |
121 FRIEND_TEST_ALL_PREFIXES(WebDatabaseMigrationTest, MigrateVersion44ToCurrent); | 126 FRIEND_TEST_ALL_PREFIXES(WebDatabaseMigrationTest, MigrateVersion44ToCurrent); |
122 | 127 |
123 // NOTE: Since the table columns have changed in different versions, many | 128 // NOTE: Since the table columns have changed in different versions, many |
124 // functions below take a |table_version| argument which dictates which | 129 // functions below take a |table_version| argument which dictates which |
125 // version number's column set to use. | 130 // version number's column set to use. |
(...skipping 18 matching lines...) Expand all Loading... |
144 std::string* result); | 149 std::string* result); |
145 | 150 |
146 // Migrates table |name| (which should be either "keywords" or | 151 // Migrates table |name| (which should be either "keywords" or |
147 // "keywords_backup") from version 44 to version 45. | 152 // "keywords_backup") from version 44 to version 45. |
148 bool MigrateKeywordsTableForVersion45(const std::string& name); | 153 bool MigrateKeywordsTableForVersion45(const std::string& name); |
149 | 154 |
150 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 155 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
151 }; | 156 }; |
152 | 157 |
153 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 158 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
OLD | NEW |