Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9121)

Unified Diff: chrome/common/extensions/api/search_engines_private.idl

Issue 1109563003: Implement remaining chrome.searchEnginesPrivate methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address last comment sync fix trybot failure Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5deccc39dd49b8dd583a5628a14507de3731ee45 100644
--- a/chrome/common/extensions/api/search_engines_private.idl
+++ b/chrome/common/extensions/api/search_engines_private.idl
@@ -6,6 +6,28 @@
// preferences from the settings UI.
namespace searchEnginesPrivate {
+ // Types of hotword features that are available.
+ enum HotwordFeature {
+ SEARCH, ALWAYS_ON, RETRAIN_LINK, AUDIO_HISTORY
+ };
+
+ // Types of search engines.
+ enum SearchEngineType {
+ DEFAULT, OTHER
+ };
+
+ 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 +35,55 @@ namespace searchEnginesPrivate {
// The name of the engine.
DOMString name;
+ // The keyword for the engine.
+ DOMString keyword;
+
+ // The URL of the engine.
+ DOMString url;
+
+ // The type of the engine.
+ SearchEngineType type;
+
// 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 search engines.
// Exactly one of the values should have default == true.
- static void getDefaultSearchEngines(SearchEnginesCallback callback);
+ static void getSearchEngines(SearchEnginesCallback callback);
// Sets the search engine with the given GUID as the selected default.
static void setSelectedSearchEngine(DOMString guid);
+
+ // 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);
+
+ // 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; |retrain| indicates whether the user wants to
+ // retrain the hotword system with their voice by launching the audio
+ // verification app.
+ 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.
- static void onDefaultSearchEnginesChanged(SearchEngine[] engines);
+ // Fires when the list of search engines changes or when the user selects a
+ // preferred default search engine. The new list of engines is passed along.
+ static void onSearchEnginesChanged(SearchEngine[] engines);
};
};

Powered by Google App Engine
This is Rietveld 408576698