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 14 matching lines...) Expand all Loading... | |
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 // 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 | 34 |
35 dictionary LaunchState { | |
36 // The mode that the Hotword Audio Verification app was launched in. | |
37 long launchMode; | |
rpetterson
2014/09/10 23:04:23
Are you planning on adding more items to this Stat
kcarattini
2014/09/11 00:08:30
Done.
| |
38 }; | |
39 | |
40 | |
35 // The type of the recognized hotword. Right now it only has 'search' but | 41 // The type of the recognized hotword. Right now it only has 'search' but |
36 // could be expanded to other types of actions in the future. | 42 // could be expanded to other types of actions in the future. |
37 enum HotwordType { search }; | 43 enum HotwordType { search }; |
38 | 44 |
39 callback GenericDoneCallback = void (); | 45 callback GenericDoneCallback = void (); |
46 callback LaunchStateCallback = void(LaunchState result); | |
40 callback StatusDetailsCallback = void(StatusDetails result); | 47 callback StatusDetailsCallback = void(StatusDetails result); |
41 | 48 |
42 interface Functions { | 49 interface Functions { |
43 // Sets the current enabled state of hotword search. | 50 // Sets the current enabled state of hotword search. |
44 // True: enable hotword search. False: disable hotword search. | 51 // True: enable hotword search. False: disable hotword search. |
45 static void setEnabled(boolean state, | 52 static void setEnabled(boolean state, |
46 optional GenericDoneCallback callback); | 53 optional GenericDoneCallback callback); |
47 | 54 |
48 // Retrieves the current state of hotword search. | 55 // Retrieves the current state of hotword search. |
49 // The result is put into a StatusDetails object. | 56 // The result is put into a StatusDetails object. |
50 static void getStatus(StatusDetailsCallback callback); | 57 static void getStatus(StatusDetailsCallback callback); |
51 | 58 |
52 // Sets the current enabled state of audio logging in the extension. | 59 // Sets the current enabled state of audio logging in the extension. |
53 // True: logging enabled. False: no logging. | 60 // True: logging enabled. False: no logging. |
54 static void setAudioLoggingEnabled(boolean state, | 61 static void setAudioLoggingEnabled(boolean state, |
55 optional GenericDoneCallback callback); | 62 optional GenericDoneCallback callback); |
56 | 63 |
57 // Sets the current state of the browser-requested hotword session. | 64 // Sets the current state of the browser-requested hotword session. |
58 static void setHotwordSessionState(boolean started, | 65 static void setHotwordSessionState(boolean started, |
59 optional GenericDoneCallback callback); | 66 optional GenericDoneCallback callback); |
60 | 67 |
61 // Notifies that a hotword has been recognized in the browser-requested | 68 // Notifies that a hotword has been recognized in the browser-requested |
62 // hotword session. | 69 // hotword session. |
63 static void notifyHotwordRecognition(HotwordType type, | 70 static void notifyHotwordRecognition(HotwordType type, |
64 optional GenericDoneCallback callback); | 71 optional GenericDoneCallback callback); |
72 | |
73 // Retrieves the state that the Hotword Audio Verification app was | |
74 // launched in. The result is put into a LaunchState object. | |
75 static void getLaunchState(LaunchStateCallback callback); | |
65 }; | 76 }; |
66 | 77 |
67 interface Events { | 78 interface Events { |
68 // Fired when the hotword search enabled preference is changed. | 79 // Fired when the hotword search enabled preference is changed. |
69 static void onEnabledChanged(); | 80 static void onEnabledChanged(); |
70 | 81 |
71 // Fired when the browser wants to start a hotword session. | 82 // Fired when the browser wants to start a hotword session. |
72 static void onHotwordSessionRequested(); | 83 static void onHotwordSessionRequested(); |
73 | 84 |
74 // Fired when the browser wants to stop the requested hotword session. | 85 // Fired when the browser wants to stop the requested hotword session. |
75 static void onHotwordSessionStopped(); | 86 static void onHotwordSessionStopped(); |
76 }; | 87 }; |
77 }; | 88 }; |
OLD | NEW |