Chromium Code Reviews| Index: chrome/common/extensions/api/search_engines_private.idl |
| diff --git a/chrome/common/extensions/api/search_engines_private.idl b/chrome/common/extensions/api/search_engines_private.idl |
| index b24d6e8313b73deb941f5ccfd330ea1f64a874aa..69ef2b8a45ed312139c4ad6ae094a796c626aa14 100644 |
| --- a/chrome/common/extensions/api/search_engines_private.idl |
| +++ b/chrome/common/extensions/api/search_engines_private.idl |
| @@ -6,6 +6,23 @@ |
| // preferences from the settings UI. |
| namespace searchEnginesPrivate { |
| + // Types of hotword features that are available. |
| + enum HotwordFeature { |
| + SEARCH, ALWAYS_ON, RETRAIN_LINK, AUDIO_HISTORY |
| + }; |
| + |
| + dictionary HotwordState { |
| + // Availability of hotword features. |
| + HotwordFeature[] availability; |
| + |
| + // State of the audio history; present if the availability includes |
| + // audio history. |
| + DOMString? audioHistoryState; |
| + |
| + // Error message when fetching hotword state if an error occurred. |
| + DOMString? errorMsg; |
| + }; |
| + |
| dictionary SearchEngine { |
| // The unique ID of the engine in the list. |
| DOMString guid; |
| @@ -13,24 +30,58 @@ namespace searchEnginesPrivate { |
| // The name of the engine. |
| DOMString name; |
| + // The keyword for the engine. |
| + DOMString keyword; |
| + |
| + // The URL of the engine. |
| + DOMString url; |
| + |
| // Whether the engine is the selected a.k.a. "default" search engine. |
| boolean? isSelected; |
| }; |
| + callback HotwordStateCallback = void (HotwordState state); |
| callback SearchEnginesCallback = void (SearchEngine[] engines); |
| interface Functions { |
| - // Gets a list of the "default” search engines. |
| + // Gets a list of the "default" search engines. |
| // Exactly one of the values should have default == true. |
| static void getDefaultSearchEngines(SearchEnginesCallback callback); |
| // Sets the search engine with the given GUID as the selected default. |
| static void setSelectedSearchEngine(DOMString guid); |
| + |
| + // Gets a list of the "other" search engines. |
| + static void getOtherSearchEngines(SearchEnginesCallback callback); |
|
stevenjb
2015/04/28 17:16:39
nit: group this with getDefaultSearchEngines
Oren Blasberg
2015/04/28 18:44:01
Done.
|
| + |
| + // Adds a new "other" (non-default) search engine with the given name, |
| + // keyword, and URL. |
| + static void addOtherSearchEngine( |
| + DOMString name, DOMString keyword, DOMString url); |
| + |
| + // Updates the search engine that has the given GUID, with the given name, |
| + // keyword, and URL. |
| + static void updateSearchEngine( |
| + DOMString guid, DOMString name, DOMString keyword, DOMString url); |
|
not at google - send to devlin
2015/04/28 16:48:46
Your API - but consider using single objects with
Oren Blasberg
2015/04/28 18:44:01
That's definitely a fair point. We already have th
|
| + |
| + // Removes the search engine with the given GUID. |
| + static void removeSearchEngine(DOMString guid); |
| + |
| + // Gets the hotword state. |
| + static void getHotwordState(HotwordStateCallback callback); |
| + |
| + // Opts in to hotwording; behavior depends on whether retrain is needed. |
|
stevenjb
2015/04/28 17:16:39
Could you elaborated on "behavior depends on wheth
Oren Blasberg
2015/04/28 18:44:01
Done.
|
| + static void optIntoHotwording(boolean retrain); |
| }; |
| interface Events { |
| // Fires when the list of default search engines changes or |
| - // when the user selects a preferred default search engine. |
| + // when the user selects a preferred default search engine. The new list of |
| + // "default" engines is passed along. |
| static void onDefaultSearchEnginesChanged(SearchEngine[] engines); |
| + |
| + // Fires when the list of "other" search engines changes. The new list |
| + // of "other" engines is passed along. |
| + static void onOtherSearchEnginesChanged(SearchEngine[] engines); |
| }; |
| }; |