Chromium Code Reviews| 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 ID is verified. | |
| 90 bool IsDefaultSearchProviderIDVerified(); | |
|
sky
2011/10/21 17:20:30
This name is a bit confusing. How about: DidDefaul
whywhat
2011/10/21 20:31:53
Done.
| |
| 91 | |
| 85 // Version of the built-in keywords. | 92 // Version of the built-in keywords. |
| 86 bool SetBuiltinKeywordVersion(int version); | 93 bool SetBuiltinKeywordVersion(int version); |
| 87 int GetBuiltinKeywordVersion(); | 94 int GetBuiltinKeywordVersion(); |
| 88 | 95 |
| 89 // Table migration functions. | 96 // Table migration functions. |
| 90 bool MigrateToVersion21AutoGenerateKeywordColumn(); | 97 bool MigrateToVersion21AutoGenerateKeywordColumn(); |
| 91 bool MigrateToVersion25AddLogoIDColumn(); | 98 bool MigrateToVersion25AddLogoIDColumn(); |
| 92 bool MigrateToVersion26AddCreatedByPolicyColumn(); | 99 bool MigrateToVersion26AddCreatedByPolicyColumn(); |
| 93 bool MigrateToVersion28SupportsInstantColumn(); | 100 bool MigrateToVersion28SupportsInstantColumn(); |
| 94 bool MigrateToVersion29InstantUrlToSupportsInstant(); | 101 bool MigrateToVersion29InstantUrlToSupportsInstant(); |
| 95 bool MigrateToVersion38AddLastModifiedColumn(); | 102 bool MigrateToVersion38AddLastModifiedColumn(); |
| 96 bool MigrateToVersion39AddSyncGUIDColumn(); | 103 bool MigrateToVersion39AddSyncGUIDColumn(); |
| 97 bool MigrateToVersion40AddDefaultSearchEngineBackup(); | 104 bool MigrateToVersion40AddDefaultSearchEngineBackup(); |
| 98 | 105 |
| 99 private: | 106 private: |
| 100 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, DefaultSearchProviderBackup); | 107 FRIEND_TEST_ALL_PREFIXES(KeywordTableTest, DefaultSearchProviderBackup); |
| 101 | 108 |
| 102 // Sets backup for id of the default search provider. | 109 // Sets backup for id of the default search provider. |
| 103 // Backup value is used to notice when unexpected change of the id | 110 // 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). | 111 // occurred (i.e. by third-party process trying to modify user settings). |
| 105 bool SetDefaultSearchProviderBackupID(int64 id); | 112 bool SetDefaultSearchProviderBackupID(int64 id); |
| 106 | 113 |
| 107 // Sets signature for the backup field. | 114 // Sets signature for the backup field. |
| 108 bool SetDefaultSearchProviderBackupIDSignature(int64 id); | 115 bool SetDefaultSearchProviderBackupIDSignature(int64 id); |
| 109 | 116 |
| 110 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 117 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
| 111 }; | 118 }; |
| 112 | 119 |
| 113 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ | 120 #endif // CHROME_BROWSER_WEBDATA_KEYWORD_TABLE_H_ |
| OLD | NEW |