Angela Yoeurng | 2400626 | 2022-04-12 19:40:09 | [diff] [blame^] | 1 | // Copyright 2022 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_ |
| 6 | #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_ |
| 7 | |
| 8 | #include <vector> |
| 9 | |
| 10 | struct TemplateURLData; |
| 11 | |
| 12 | // The Starter Pack is a set of built-in search engines that allow the user to |
| 13 | // search various parts of Chrome from the Omnibox through keyword mode. Unlike |
| 14 | // prepopulated engines, starter pack scopes are not "search engines" that |
| 15 | // search the web. Instead, they use the built-in omnibox providers to provide |
| 16 | // suggestions. This file defines those search engines and util functions. |
| 17 | |
| 18 | namespace TemplateURLStarterPackData { |
| 19 | |
| 20 | struct StarterPackEngine { |
| 21 | int name_message_id; |
| 22 | int keyword_message_id; |
| 23 | const char* const favicon_url; |
| 24 | const char* const search_url; |
| 25 | const int id; |
| 26 | }; |
| 27 | |
| 28 | extern const int kMaxStarterPackEngineID; |
| 29 | extern const int kCurrentDataVersion; |
| 30 | |
| 31 | // Returns the current version of the starterpack data, so callers can know when |
| 32 | // they need to re-merge. |
| 33 | int GetDataVersion(); |
| 34 | |
| 35 | // Returns a vector of all starter pack engines, in TemplateURLData format. |
| 36 | std::vector<std::unique_ptr<TemplateURLData>> GetStarterPackEngines(); |
| 37 | |
| 38 | } // namespace TemplateURLStarterPackData |
| 39 | |
| 40 | #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_ |