Update CrOS OOBE throbber to MD throbber; delete old asset
[chromium-blink-merge.git] / chrome / common / extensions / api / search_engines_private.idl
blob5deccc39dd49b8dd583a5628a14507de3731ee45
1 // Copyright 2015 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.
5 // Use the <code>chrome.searchEnginesPrivate</code> API to get or set
6 // preferences from the settings UI.
7 namespace searchEnginesPrivate {
9 // Types of hotword features that are available.
10 enum HotwordFeature {
11 SEARCH, ALWAYS_ON, RETRAIN_LINK, AUDIO_HISTORY
14 // Types of search engines.
15 enum SearchEngineType {
16 DEFAULT, OTHER
19 dictionary HotwordState {
20 // Availability of hotword features.
21 HotwordFeature[] availability;
23 // State of the audio history; present if the availability includes
24 // audio history.
25 DOMString? audioHistoryState;
27 // Error message when fetching hotword state if an error occurred.
28 DOMString? errorMsg;
31 dictionary SearchEngine {
32 // The unique ID of the engine in the list.
33 DOMString guid;
35 // The name of the engine.
36 DOMString name;
38 // The keyword for the engine.
39 DOMString keyword;
41 // The URL of the engine.
42 DOMString url;
44 // The type of the engine.
45 SearchEngineType type;
47 // Whether the engine is the selected a.k.a. "default" search engine.
48 boolean? isSelected;
51 callback HotwordStateCallback = void (HotwordState state);
52 callback SearchEnginesCallback = void (SearchEngine[] engines);
54 interface Functions {
55 // Gets a list of the search engines.
56 // Exactly one of the values should have default == true.
57 static void getSearchEngines(SearchEnginesCallback callback);
59 // Sets the search engine with the given GUID as the selected default.
60 static void setSelectedSearchEngine(DOMString guid);
62 // Adds a new "other" (non-default) search engine with the given name,
63 // keyword, and URL.
64 static void addOtherSearchEngine(
65 DOMString name, DOMString keyword, DOMString url);
67 // Updates the search engine that has the given GUID, with the given name,
68 // keyword, and URL.
69 static void updateSearchEngine(
70 DOMString guid, DOMString name, DOMString keyword, DOMString url);
72 // Removes the search engine with the given GUID.
73 static void removeSearchEngine(DOMString guid);
75 // Gets the hotword state.
76 static void getHotwordState(HotwordStateCallback callback);
78 // Opts in to hotwording; |retrain| indicates whether the user wants to
79 // retrain the hotword system with their voice by launching the audio
80 // verification app.
81 static void optIntoHotwording(boolean retrain);
84 interface Events {
85 // Fires when the list of search engines changes or when the user selects a
86 // preferred default search engine. The new list of engines is passed along.
87 static void onSearchEnginesChanged(SearchEngine[] engines);