| // Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Specification at: |
| // https://w3c.github.io/sensors/#the-sensor-interface |
| |
| [ |
| ActiveScriptWrappable, |
| SecureContext, |
| RuntimeEnabled=Sensor, |
| Exposed=Window |
| ] interface Sensor : EventTarget { |
| [MeasureAs=GenericSensorActivated] readonly attribute boolean activated; |
| readonly attribute boolean hasReading; |
| [CallWith=ScriptState] readonly attribute DOMHighResTimeStamp? timestamp; |
| |
| [MeasureAs=GenericSensorStart] void start(); |
| [MeasureAs=GenericSensorStop] void stop(); |
| |
| [MeasureAs=GenericSensorOnError] attribute EventHandler onerror; |
| [MeasureAs=GenericSensorOnChange] attribute EventHandler onreading; |
| [MeasureAs=GenericSensorOnActivate] attribute EventHandler onactivate; |
| }; |