Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // The <code>chrome.hotwordPrivate</code> API allows extensions to access and | 5 // The <code>chrome.hotwordPrivate</code> API allows extensions to access and |
| 6 // mutate the preference for enabling hotword search. It also provides | 6 // mutate the preference for enabling hotword search. It also provides |
| 7 // information on whether the hotword search is available. This API provides an | 7 // information on whether the hotword search is available. This API provides an |
| 8 // event interface to transmit to the extension a signal that the preference fo | 8 // event interface to transmit to the extension a signal that the preference fo |
| 9 // hotword search has change. | 9 // hotword search has change. |
| 10 // | 10 // |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 boolean enabled; | 21 boolean enabled; |
| 22 | 22 |
| 23 // Whether the hotword extension is available to be enabled | 23 // Whether the hotword extension is available to be enabled |
| 24 boolean available; | 24 boolean available; |
| 25 | 25 |
| 26 // Whether the sound of "Ok, Google" plus a few seconds before is sent | 26 // Whether the sound of "Ok, Google" plus a few seconds before is sent |
| 27 // back to Google. | 27 // back to Google. |
| 28 boolean audioLoggingEnabled; | 28 boolean audioLoggingEnabled; |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // The type of the recognized hotword. Right now it only has 'search' but | |
| 32 // could be expanded to other types of actions in the future. | |
| 33 enum HotwordType { search }; | |
| 34 | |
| 31 callback GenericDoneCallback = void (); | 35 callback GenericDoneCallback = void (); |
| 32 callback StatusDetailsCallback = void(StatusDetails result); | 36 callback StatusDetailsCallback = void(StatusDetails result); |
| 33 | 37 |
| 34 interface Functions { | 38 interface Functions { |
| 35 // Sets the current enabled state of hotword search. | 39 // Sets the current enabled state of hotword search. |
| 36 // True: enable hotword search. False: disable hotword search. | 40 // True: enable hotword search. False: disable hotword search. |
| 37 static void setEnabled(boolean state, optional GenericDoneCallback callback) ; | 41 static void setEnabled(boolean state, optional GenericDoneCallback callback) ; |
| 38 | 42 |
| 39 // Retrieves the current state of hotword search. | 43 // Retrieves the current state of hotword search. |
| 40 // The result is put into a StatusDetails object. | 44 // The result is put into a StatusDetails object. |
| 41 static void getStatus(StatusDetailsCallback callback); | 45 static void getStatus(StatusDetailsCallback callback); |
| 42 | 46 |
| 43 // Sets the current enabled state of audio logging in the extension. | 47 // Sets the current enabled state of audio logging in the extension. |
| 44 // True: logging enabled. False: no logging. | 48 // True: logging enabled. False: no logging. |
| 45 static void setAudioLoggingEnabled(boolean state, optional GenericDoneCallba ck callback); | 49 static void setAudioLoggingEnabled(boolean state, optional GenericDoneCallba ck callback); |
| 50 | |
| 51 // Sets the current hotword session state for the browser's special request. | |
|
rpetterson
2014/05/02 19:13:16
What does the "browser's special request" mean?
Jun Mukai
2014/05/02 22:18:57
that is browser-requested hotword session. updated
| |
| 52 // See onHotwordSessionRequested() and onHotwordSessionStopped(). | |
| 53 static void setHotwordSessionState(boolean started, optional GenericDoneCall back callback); | |
| 54 | |
| 55 // Notifies the hotword is recognized for the browser-requested hotword | |
|
rpetterson
2014/05/02 19:13:16
If I'm understanding correctly, this function is u
Jun Mukai
2014/05/02 22:18:57
Done.
| |
| 56 // session. | |
| 57 static void notifyHotwordRecognition(HotwordType type, optional GenericDoneC allback callback); | |
| 46 }; | 58 }; |
| 47 | 59 |
| 48 interface Events { | 60 interface Events { |
| 49 // Fired when the hotword search enabled preference is changed. | 61 // Fired when the hotword search enabled preference is changed. |
| 50 static void onEnabledChanged(); | 62 static void onEnabledChanged(); |
| 63 | |
| 64 // Fired when the browser wants to start a hotword session. | |
| 65 static void onHotwordSessionRequested(); | |
| 66 | |
| 67 // Fired when the browser wants to stop the requested hotword session. | |
| 68 static void onHotwordSessionStopped(); | |
| 51 }; | 69 }; |
| 52 }; | 70 }; |
| OLD | NEW |