| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/string16.h" |
| 12 #include "chrome/browser/webdata/web_database_table.h" | 13 #include "chrome/browser/webdata/web_database_table.h" |
| 13 #include "chrome/browser/search_engines/template_url_id.h" | 14 #include "chrome/browser/search_engines/template_url_id.h" |
| 14 | 15 |
| 15 class GURL; | 16 class GURL; |
| 16 class TemplateURL; | 17 class TemplateURL; |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class Time; | 20 class Time; |
| 20 } | 21 } |
| 21 | 22 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 bool GetKeywords(std::vector<TemplateURL*>* urls); | 76 bool GetKeywords(std::vector<TemplateURL*>* urls); |
| 76 | 77 |
| 77 // Updates the database values for the specified url. | 78 // Updates the database values for the specified url. |
| 78 // Returns true on success. | 79 // Returns true on success. |
| 79 bool UpdateKeyword(const TemplateURL& url); | 80 bool UpdateKeyword(const TemplateURL& url); |
| 80 | 81 |
| 81 // ID (TemplateURL->id) of the default search provider. | 82 // ID (TemplateURL->id) of the default search provider. |
| 82 bool SetDefaultSearchProviderID(int64 id); | 83 bool SetDefaultSearchProviderID(int64 id); |
| 83 int64 GetDefaultSearchProviderID(); | 84 int64 GetDefaultSearchProviderID(); |
| 84 | 85 |
| 86 // Backup of the default search provider. 0 if the setting can't be verified. |
| 87 int64 GetDefaultSearchProviderIDBackup(); |
| 88 |
| 89 // Returns true if the default search provider has been changed out under |
| 90 // us. This can happen if another process modifies our database or the |
| 91 // file was corrupted. |
| 92 bool DidDefaultSearchProviderChange(); |
| 93 |
| 85 // Version of the built-in keywords. | 94 // Version of the built-in keywords. |
| 86 bool SetBuiltinKeywordVersion(int version); | 95 bool SetBuiltinKeywordVersion(int version); |
| 87 int GetBuiltinKeywordVersion(); | 96 int GetBuiltinKeywordVersion(); |
| 88 | 97 |
| 89 // Table migration functions. | 98 // Table migration functions. |
| 90 bool MigrateToVersion21AutoGenerateKeywordColumn(); | 99 bool MigrateToVersion21AutoGenerateKeywordColumn(); |
| 91 bool MigrateToVersion25AddLogoIDColumn(); | 100 bool MigrateToVersion25AddLogoIDColumn(); |
| 92 bool MigrateToVersion26AddCreatedByPolicyColumn(); | 101 bool MigrateToVersion26AddCreatedByPolicyColumn(); |
| 93 bool MigrateToVersion28SupportsInstantColumn(); | 102 bool MigrateToVersion28SupportsInstantColumn(); |
| 94 bool MigrateToVersion29InstantUrlToSupportsInstant(); | 103 bool MigrateToVersion29InstantUrlToSupportsInstant(); |
| 95 bool MigrateToVersion38AddLastModifiedColumn(); | 104 bool MigrateToVersion38AddLastModifiedColumn(); |
| 96 bool MigrateToVersion39AddSyncGUIDColumn(); | 105 bool MigrateToVersion39AddSyncGUIDColumn(); |
| 97 bool MigrateToVersion40AddDefaultSearchEngineBackup(); | 106 bool MigrateToVersion40AddDefaultSearchEngineBackup(); |
| 98 | 107 |
| 99 private: | 108 private: |
| 100 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, DefaultSearchProviderBackup); | 109 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, DefaultSearchProviderBackup); |
| 101 | 110 |
| 102 // Sets backup for id of the default search provider. | 111 // Sets backup for id of the default search provider. |
| 103 // Backup value is used to notice when unexpected change of the id | 112 // Backup value is used to notice when unexpected change of the id |
| 104 // occurred (i.e. by third-party process trying to modify user settings). | 113 // occurred (i.e. by third-party process trying to modify user settings). |
| 105 bool SetDefaultSearchProviderBackupID(int64 id); | 114 bool SetDefaultSearchProviderBackupID(int64 id); |
| 106 | 115 |
| 107 // Sets signature for the backup field. | 116 // Sets signature for the backup field. |
| 108 bool SetDefaultSearchProviderBackupIDSignature(int64 id); | 117 bool SetDefaultSearchProviderBackupIDSignature(int64 id); |
| 109 | 118 |
| 110 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 119 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
| 111 }; | 120 }; |
| 112 | 121 |
| 113 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 122 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
| OLD | NEW |