1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_
12 #include "components/search_engines/search_engine_type.h"
14 struct TemplateURLData;
16 // The Starter Pack is a set of built-in search engines that allow the user to
17 // search various parts of Chrome from the Omnibox through keyword mode. Unlike
18 // prepopulated engines, starter pack scopes are not "search engines" that
19 // search the web. Instead, they use the built-in omnibox providers to provide
20 // suggestions. This file defines those search engines and util functions.
22 namespace TemplateURLStarterPackData {
32 struct StarterPackEngine {
34 int keyword_message_id;
35 const char* const favicon_url;
36 const char* const search_url;
37 const char* const destination_url;
38 const StarterPackID id;
39 const SearchEngineType type;
42 extern const int kCurrentDataVersion;
43 extern const int kFirstCompatibleDataVersion;
45 // Exposed for testing purposes
46 extern const StarterPackEngine bookmarks;
47 extern const StarterPackEngine history;
48 extern const StarterPackEngine tabs;
50 // Returns the current version of the starterpack data, so callers can know when
51 // they need to re-merge.
54 // Returns the first compatible data version to the current data. Any starter
55 // pack data version before this will be force updated regardless of user edits.
56 int GetFirstCompatibleDataVersion();
58 // Returns a vector of all starter pack engines, in TemplateURLData format.
59 std::vector<std::unique_ptr<TemplateURLData>> GetStarterPackEngines();
61 // Returns the destination url for the starter pack engine associated with a
62 // given starter pack id.
63 std::u16string GetDestinationUrlForStarterPackID(int id);
65 } // namespace TemplateURLStarterPackData
67 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_