| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 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 [ |
| 6 { |
| 7 "namespace": "idle", |
| 8 "types": [], |
| 9 "functions": [ |
| 10 { |
| 11 "name": "queryState", |
| 12 "type": "function", |
| 13 "description": "Returns \"locked\" if the system is locked, \"idle\" if
the user has not generated any input for a specified number of seconds, or \"act
ive\" otherwise.", |
| 14 "parameters": [ |
| 15 { |
| 16 "name": "detectionIntervalInSeconds", |
| 17 "type": "integer", |
| 18 "minimum": 15, |
| 19 "description": "The system is considered idle if detectionIntervalIn
Seconds seconds have elapsed since the last user input detected." |
| 20 }, |
| 21 { |
| 22 "name": "callback", |
| 23 "type": "function", |
| 24 "parameters": [ |
| 25 { |
| 26 "name": "newState", |
| 27 "type": "string", |
| 28 "enum": ["active", "idle", "locked"] |
| 29 } |
| 30 ] |
| 31 } |
| 32 ] |
| 33 }, |
| 34 { |
| 35 "name": "setDetectionInterval", |
| 36 "type": "function", |
| 37 "description": "Sets the interval, in seconds, used to determine when th
e system is in an idle state for onStateChanged events. The default interval is
60 seconds.", |
| 38 "parameters": [ |
| 39 { |
| 40 "name": "intervalInSeconds", |
| 41 "type": "integer", |
| 42 "minimum": 15, |
| 43 "description": "Threshold, in seconds, used to determine when the sy
stem is in an idle state." |
| 44 } |
| 45 ] |
| 46 } |
| 47 ], |
| 48 "events": [ |
| 49 { |
| 50 "name": "onStateChanged", |
| 51 "type": "function", |
| 52 "description": "Fired when the system changes to an active, idle or lock
ed state. The event fires with \"locked\" if the screen is locked or the screens
aver activates, \"idle\" if the system is unlocked and the user has not generate
d any input for a specified number of seconds, and \"active\" when the user gene
rates input on an idle system.", |
| 53 "parameters": [ |
| 54 { |
| 55 "name": "newState", |
| 56 "type": "string", |
| 57 "enum": ["active", "idle", "locked"] |
| 58 } |
| 59 ] |
| 60 } |
| 61 ] |
| 62 } |
| 63 ] |
| OLD | NEW |