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 | |
Stephan Hartmann | aca38ff | 2022-04-13 20:09:49 | [diff] [blame] | 8 | #include <memory> |
Angela Yoeurng | 2400626 | 2022-04-12 19:40:09 | [diff] [blame] | 9 | #include <vector> |
| 10 | |
Angela Yoeurng | 75ef818 | 2022-04-18 23:39:22 | [diff] [blame^] | 11 | #include "components/search_engines/search_engine_type.h" |
| 12 | |
Angela Yoeurng | 2400626 | 2022-04-12 19:40:09 | [diff] [blame] | 13 | struct TemplateURLData; |
| 14 | |
| 15 | // The Starter Pack is a set of built-in search engines that allow the user to |
| 16 | // search various parts of Chrome from the Omnibox through keyword mode. Unlike |
| 17 | // prepopulated engines, starter pack scopes are not "search engines" that |
| 18 | // search the web. Instead, they use the built-in omnibox providers to provide |
| 19 | // suggestions. This file defines those search engines and util functions. |
| 20 | |
| 21 | namespace TemplateURLStarterPackData { |
| 22 | |
| 23 | struct StarterPackEngine { |
| 24 | int name_message_id; |
| 25 | int keyword_message_id; |
| 26 | const char* const favicon_url; |
| 27 | const char* const search_url; |
| 28 | const int id; |
Angela Yoeurng | 75ef818 | 2022-04-18 23:39:22 | [diff] [blame^] | 29 | const SearchEngineType type; |
Angela Yoeurng | 2400626 | 2022-04-12 19:40:09 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | extern const int kMaxStarterPackEngineID; |
| 33 | extern const int kCurrentDataVersion; |
| 34 | |
| 35 | // Returns the current version of the starterpack data, so callers can know when |
| 36 | // they need to re-merge. |
| 37 | int GetDataVersion(); |
| 38 | |
| 39 | // Returns a vector of all starter pack engines, in TemplateURLData format. |
| 40 | std::vector<std::unique_ptr<TemplateURLData>> GetStarterPackEngines(); |
| 41 | |
| 42 | } // namespace TemplateURLStarterPackData |
| 43 | |
| 44 | #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_ |