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 <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" |
13 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
14 #include "components/search_engines/template_url_id.h" | 17 #include "components/search_engines/template_url_id.h" |
15 #include "components/webdata/common/web_database_table.h" | 18 #include "components/webdata/common/web_database_table.h" |
16 | 19 |
17 struct TemplateURLData; | 20 struct TemplateURLData; |
18 class WebDatabase; | 21 class WebDatabase; |
19 | 22 |
20 namespace sql { | 23 namespace sql { |
21 class Statement; | 24 class Statement; |
22 } // namespace sql | 25 } // namespace sql |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // to perform a large number of operations, doing them in a single transaction | 110 // to perform a large number of operations, doing them in a single transaction |
108 // instead of one-per-transaction can be dramatically more efficient. | 111 // instead of one-per-transaction can be dramatically more efficient. |
109 bool PerformOperations(const Operations& operations); | 112 bool PerformOperations(const Operations& operations); |
110 | 113 |
111 // Loads the keywords into the specified vector. It's up to the caller to | 114 // Loads the keywords into the specified vector. It's up to the caller to |
112 // delete the returned objects. | 115 // delete the returned objects. |
113 // Returns true on success. | 116 // Returns true on success. |
114 bool GetKeywords(Keywords* keywords); | 117 bool GetKeywords(Keywords* keywords); |
115 | 118 |
116 // ID (TemplateURLData->id) of the default search provider. | 119 // ID (TemplateURLData->id) of the default search provider. |
117 bool SetDefaultSearchProviderID(int64 id); | 120 bool SetDefaultSearchProviderID(int64_t id); |
118 int64 GetDefaultSearchProviderID(); | 121 int64_t GetDefaultSearchProviderID(); |
119 | 122 |
120 // Version of the built-in keywords. | 123 // Version of the built-in keywords. |
121 bool SetBuiltinKeywordVersion(int version); | 124 bool SetBuiltinKeywordVersion(int version); |
122 int GetBuiltinKeywordVersion(); | 125 int GetBuiltinKeywordVersion(); |
123 | 126 |
124 // Returns a comma-separated list of the keyword columns for the current | 127 // Returns a comma-separated list of the keyword columns for the current |
125 // version of the table. | 128 // version of the table. |
126 static std::string GetKeywordColumns(); | 129 static std::string GetKeywordColumns(); |
127 | 130 |
128 // Table migration functions. | 131 // Table migration functions. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 std::string* result); | 166 std::string* result); |
164 | 167 |
165 // Migrates table |name| (which should be either "keywords" or | 168 // Migrates table |name| (which should be either "keywords" or |
166 // "keywords_backup") from version 44 to version 45. | 169 // "keywords_backup") from version 44 to version 45. |
167 bool MigrateKeywordsTableForVersion45(const std::string& name); | 170 bool MigrateKeywordsTableForVersion45(const std::string& name); |
168 | 171 |
169 DISALLOW_COPY_AND_ASSIGN(KeywordTable); | 172 DISALLOW_COPY_AND_ASSIGN(KeywordTable); |
170 }; | 173 }; |
171 | 174 |
172 #endif // COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ | 175 #endif // COMPONENTS_SEARCH_ENGINES_KEYWORD_TABLE_H_ |
OLD | NEW |