| 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 15 matching lines...) Expand all Loading... |
| 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 // Whether experimental hotwording functionality is enabled. Mirrors the | 30 // Whether experimental hotwording functionality is enabled. Mirrors the |
| 31 // "enable-experimental-hotwording" flag. | 31 // "enable-experimental-hotwording" flag. |
| 32 boolean experimentalHotwordEnabled; | 32 boolean experimentalHotwordEnabled; |
| 33 | 33 |
| 34 // Whether always-on hotwording is enabled. | 34 // Whether always-on hotwording is enabled. |
| 35 boolean alwaysOnEnabled; | 35 boolean alwaysOnEnabled; |
| 36 |
| 37 // Whether training mode is enabled. |
| 38 boolean trainingEnabled; |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 dictionary LaunchState { | 41 dictionary LaunchState { |
| 39 // TODO(kcarattini): Consider adding more variables here, | 42 // TODO(kcarattini): Consider adding more variables here, |
| 40 // such as the available state of the hotword service. | 43 // such as the available state of the hotword service. |
| 41 | 44 |
| 42 // The mode that the Hotword Audio Verification app was launched in. | 45 // The mode that the Hotword Audio Verification app was launched in. |
| 43 long launchMode; | 46 long launchMode; |
| 44 }; | 47 }; |
| 45 | 48 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 optional GenericDoneCallback callback); | 81 optional GenericDoneCallback callback); |
| 79 | 82 |
| 80 // Notifies that a hotword has been recognized in the browser-requested | 83 // Notifies that a hotword has been recognized in the browser-requested |
| 81 // hotword session. | 84 // hotword session. |
| 82 static void notifyHotwordRecognition(HotwordType type, | 85 static void notifyHotwordRecognition(HotwordType type, |
| 83 optional GenericDoneCallback callback); | 86 optional GenericDoneCallback callback); |
| 84 | 87 |
| 85 // Retrieves the state that the Hotword Audio Verification app was | 88 // Retrieves the state that the Hotword Audio Verification app was |
| 86 // launched in. The result is put into a LaunchState object. | 89 // launched in. The result is put into a LaunchState object. |
| 87 static void getLaunchState(LaunchStateCallback callback); | 90 static void getLaunchState(LaunchStateCallback callback); |
| 91 |
| 92 // Starts the speaker model training. |
| 93 static void startTraining(optional GenericDoneCallback callback); |
| 94 |
| 95 // Finalizess the speaker model. |
| 96 static void finalizeSpeakerModel(optional GenericDoneCallback callback); |
| 97 |
| 98 // Stops the speaker model training. |
| 99 static void stopTraining(optional GenericDoneCallback callback); |
| 88 }; | 100 }; |
| 89 | 101 |
| 90 interface Events { | 102 interface Events { |
| 91 // Fired when the hotword search enabled preference is changed. | 103 // Fired when the hotword search enabled preference is changed. |
| 92 static void onEnabledChanged(); | 104 static void onEnabledChanged(); |
| 93 | 105 |
| 94 // Fired when the browser wants to start a hotword session. | 106 // Fired when the browser wants to start a hotword session. |
| 95 static void onHotwordSessionRequested(); | 107 static void onHotwordSessionRequested(); |
| 96 | 108 |
| 97 // Fired when the browser wants to stop the requested hotword session. | 109 // Fired when the browser wants to stop the requested hotword session. |
| 98 static void onHotwordSessionStopped(); | 110 static void onHotwordSessionStopped(); |
| 111 |
| 112 // Fired when the speaker model should be finalized. |
| 113 static void onFinalizeSpeakerModel(); |
| 114 |
| 115 // Fired when a hotword has triggered. |
| 116 static void onHotwordTriggered(); |
| 99 }; | 117 }; |
| 100 }; | 118 }; |
| OLD | NEW |