Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / hotword_private.idl
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
3 // found in the LICENSE file.
4
5 // The <code>chrome.hotwordPrivate</code> API allows extensions to access and
6 // mutate the preference for enabling hotword search. It also provides
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
9 // hotword search has change.
10 //
11 // For an FYI, visit http://goo.gl/AyHbkH
12
13 [nodoc] namespace hotwordPrivate {
14
15   dictionary StatusDetails {
16     // If the hotword extension is enabled. Will always be false if |available|
17     // is false.
18     boolean enabled;
19
20     // Whether the hotword extension is available to be enabled
21     boolean available;
22   };
23
24   callback GenericDoneCallback = void ();
25   callback StatusDetailsCallback = void(StatusDetails result);
26
27   interface Functions {
28     // Sets the current enabled state of hotword search.
29     // True: enable hotword search. False: disable hotword search.
30     static void setEnabled(boolean state, optional GenericDoneCallback callback);
31
32     // Retrieves the current state of hotword search.
33     // The result is put into a StatusDetails object.
34     static void getStatus(StatusDetailsCallback callback);
35   };
36
37   interface Events {
38     // Fired when the hotword search enabled preference is changed.
39     static void onEnabledChanged();
40   };
41 };