Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / screenlock_private.idl
1 // Copyright 2013 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 // Control and monitor the screen locker.
6 [platforms=("chromeos"), implemented_in="chrome/browser/chromeos/extensions/screenlock_private_api.h", permissions=screenlockPrivate]
7 namespace screenlockPrivate {
8   callback BooleanCallback = void(boolean locked);
9
10   interface Functions {
11     // Returns true if the screen is currently locked, false otherwise.
12     static void getLocked(BooleanCallback callback);
13
14     // Set <code>locked=true</code> to lock the screen,
15     // <code>locked=false</code> to unlock it.
16     static void setLocked(boolean locked);
17
18     // Show a message to the user on the unlock UI if the screen is locked.
19     static void showMessage(DOMString message);
20
21     // Show a button icon on the unlock UI if the screen is locked.
22     static void showButton(DOMString icon);
23   };
24
25   interface Events {
26     // Fires whenever the screen is locked or unlocked.
27     static void onChanged(boolean locked);
28
29     // Fires when the user presses the button on the unlock UI shown by
30     // $ref:showButton().
31     static void onButtonClicked();
32   };
33 };