Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1194)

Unified Diff: chrome/browser/webdata/keyword_table.cc

Issue 12518017: Generalize migration code in WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/webdata/keyword_table.h ('k') | chrome/browser/webdata/logins_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/keyword_table.cc
diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc
index 53e15dd6c0dfa498d42f42d749c20d17d3f16e21..15fba4131d3b5aafdd8306624f91c1a6f63980f7 100644
--- a/chrome/browser/webdata/keyword_table.cc
+++ b/chrome/browser/webdata/keyword_table.cc
@@ -152,6 +152,52 @@ bool KeywordTable::IsSyncable() {
return true;
}
+bool KeywordTable::MigrateToVersion(int version,
+ const std::string& app_locale,
+ bool* update_compatible_version) {
+ // Migrate if necessary.
+ switch (version) {
+ case 21:
+ *update_compatible_version = true;
+ return MigrateToVersion21AutoGenerateKeywordColumn();
+ case 25:
+ *update_compatible_version = true;
+ return MigrateToVersion25AddLogoIDColumn();
+ case 26:
+ *update_compatible_version = true;
+ return MigrateToVersion26AddCreatedByPolicyColumn();
+ case 28:
+ *update_compatible_version = true;
+ return MigrateToVersion28SupportsInstantColumn();
+ case 29:
+ *update_compatible_version = true;
+ return MigrateToVersion29InstantURLToSupportsInstant();
+ case 38:
+ *update_compatible_version = true;
+ return MigrateToVersion38AddLastModifiedColumn();
+ case 39:
+ *update_compatible_version = true;
+ return MigrateToVersion39AddSyncGUIDColumn();
+ case 44:
+ *update_compatible_version = true;
+ return MigrateToVersion44AddDefaultSearchProviderBackup();
+ case 45:
+ *update_compatible_version = true;
+ return MigrateToVersion45RemoveLogoIDAndAutogenerateColumns();
+ case 47:
+ *update_compatible_version = true;
+ return MigrateToVersion47AddAlternateURLsColumn();
+ case 48:
+ *update_compatible_version = true;
+ return MigrateToVersion48RemoveKeywordsBackup();
+ case 49:
+ *update_compatible_version = true;
+ return MigrateToVersion49AddSearchTermsReplacementKeyColumn();
+ }
+
+ return true;
+}
+
bool KeywordTable::AddKeyword(const TemplateURLData& data) {
DCHECK(data.id);
std::string query("INSERT INTO keywords (" + GetKeywordColumns() +
« no previous file with comments | « chrome/browser/webdata/keyword_table.h ('k') | chrome/browser/webdata/logins_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698