blob: a7d3cd2226ca7bf545fc42ba99ec6e6d714b0119 [file] [log] [blame]
Angela Yoeurng24006262022-04-12 19:40:091// 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 Hartmannaca38ff2022-04-13 20:09:498#include <memory>
Angela Yoeurng24006262022-04-12 19:40:099#include <vector>
10
Angela Yoeurng75ef8182022-04-18 23:39:2211#include "components/search_engines/search_engine_type.h"
12
Angela Yoeurng24006262022-04-12 19:40:0913struct 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
21namespace TemplateURLStarterPackData {
22
Angela Yoeurng638e2402022-05-18 00:25:0723typedef enum {
24 kBookmarks = 1,
25 kHistory = 2,
26
27 kMaxStarterPackID
28} StarterPackID;
29
Angela Yoeurng24006262022-04-12 19:40:0930struct StarterPackEngine {
31 int name_message_id;
32 int keyword_message_id;
33 const char* const favicon_url;
34 const char* const search_url;
Angela Yoeurng638e2402022-05-18 00:25:0735 const StarterPackID id;
Angela Yoeurng75ef8182022-04-18 23:39:2236 const SearchEngineType type;
Angela Yoeurng24006262022-04-12 19:40:0937};
38
Angela Yoeurng24006262022-04-12 19:40:0939extern const int kCurrentDataVersion;
40
Angela Yoeurng10424ca2022-05-19 01:46:4641/* Exposed for testing purposes */
42extern const StarterPackEngine bookmarks;
43extern const StarterPackEngine history;
44
Angela Yoeurng24006262022-04-12 19:40:0945// Returns the current version of the starterpack data, so callers can know when
46// they need to re-merge.
47int GetDataVersion();
48
49// Returns a vector of all starter pack engines, in TemplateURLData format.
50std::vector<std::unique_ptr<TemplateURLData>> GetStarterPackEngines();
51
52} // namespace TemplateURLStarterPackData
53
54#endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_STARTER_PACK_DATA_H_