| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 // Use the <code>system.display</code> API to query display metadata. | 5 // Use the <code>system.display</code> API to query display metadata. |
| 6 namespace system.display { | 6 namespace system.display { |
| 7 | 7 |
| 8 dictionary Bounds { | 8 dictionary Bounds { |
| 9 // The x-coordinate of the upper-left corner. | 9 // The x-coordinate of the upper-left corner. |
| 10 long left; | 10 long left; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 long? boundsOriginY; | 200 long? boundsOriginY; |
| 201 | 201 |
| 202 // If set, updates the display mode to the mode matching this value. | 202 // If set, updates the display mode to the mode matching this value. |
| 203 DisplayMode? displayMode; | 203 DisplayMode? displayMode; |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo); | 206 callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo); |
| 207 callback DisplayLayoutCallback = void (DisplayLayout[] layouts); | 207 callback DisplayLayoutCallback = void (DisplayLayout[] layouts); |
| 208 callback SetDisplayUnitInfoCallback = void(); | 208 callback SetDisplayUnitInfoCallback = void(); |
| 209 callback SetDisplayLayoutCallback = void(); | 209 callback SetDisplayLayoutCallback = void(); |
| 210 callback NativeTouchCalibrationCallback = void(boolean success); |
| 210 | 211 |
| 211 interface Functions { | 212 interface Functions { |
| 212 // Get the information of all attached display devices. | 213 // Get the information of all attached display devices. |
| 213 static void getInfo(DisplayInfoCallback callback); | 214 static void getInfo(DisplayInfoCallback callback); |
| 214 | 215 |
| 215 // Get the layout info for all displays. | 216 // Get the layout info for all displays. |
| 216 // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. | 217 // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. |
| 217 static void getDisplayLayout(DisplayLayoutCallback callback); | 218 static void getDisplayLayout(DisplayLayoutCallback callback); |
| 218 | 219 |
| 219 // Updates the properties for the display specified by |id|, according to | 220 // Updates the properties for the display specified by |id|, according to |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // Resets the overscan insets for a display to the last saved value (i.e | 270 // Resets the overscan insets for a display to the last saved value (i.e |
| 270 // before Start was called). | 271 // before Start was called). |
| 271 // |id|: The display's unique identifier. | 272 // |id|: The display's unique identifier. |
| 272 static void overscanCalibrationReset(DOMString id); | 273 static void overscanCalibrationReset(DOMString id); |
| 273 | 274 |
| 274 // Complete overscan adjustments for a display by saving the current values | 275 // Complete overscan adjustments for a display by saving the current values |
| 275 // and hiding the overlay. | 276 // and hiding the overlay. |
| 276 // |id|: The display's unique identifier. | 277 // |id|: The display's unique identifier. |
| 277 static void overscanCalibrationComplete(DOMString id); | 278 static void overscanCalibrationComplete(DOMString id); |
| 278 | 279 |
| 279 // Starts touch calibration for a display. This will show an overlay on the | 280 // Displays the native touch calibration UX for the display with |id| as |
| 280 // screen and initialize the UX for touch calibration. If touch calibration | 281 // display id. This will show an overlay on the screen with required |
| 281 // for display |id| is already in progress this will throw an error. | 282 // instructions on how to proceed. The callback will be invoked in case of |
| 283 // successful calibraion only. If the calibration fails, this will throw an |
| 284 // error. |
| 282 // |id|: The display's unique identifier. | 285 // |id|: The display's unique identifier. |
| 283 static void touchCalibrationStart(DOMString id); | 286 // |callback|: Optional callback to inform the caller that the touch |
| 287 // calibration has ended. The argument of the callback informs if the |
| 288 // calibration was a success or not. |
| 289 static void showNativeTouchCalibration( |
| 290 DOMString id, optional NativeTouchCalibrationCallback callback); |
| 291 |
| 292 // Starts custom touch calibration for a display. This should be called when |
| 293 // using a custom UX for collecting calibration data. If another touch |
| 294 // calibration is already in progress this will throw an error. |
| 295 // |id|: The display's unique identifier. |
| 296 static void startCustomTouchCalibration(DOMString id); |
| 284 | 297 |
| 285 // Sets the touch calibration pairs for a display. These |pairs| would be | 298 // Sets the touch calibration pairs for a display. These |pairs| would be |
| 286 // used to calibrate the touch screen for display |id|. If touch calibration | 299 // used to calibrate the touch screen for display with |id| called in |
| 287 // for display |id| is in progress this will do nothing. | 300 // startCustomTouchCalibration(). Always call |startCustomTouchCalibration| |
| 288 // |id|: The display's unique identifier. | 301 // before calling this method. If another touch calibration is already in |
| 302 // progress this will throw an error. |
| 289 // |pairs|: The pairs of point used to calibrate the display. | 303 // |pairs|: The pairs of point used to calibrate the display. |
| 290 // |bounds|: Bounds of the display when the touch calibration was performed. | 304 // |bounds|: Bounds of the display when the touch calibration was performed. |
| 291 // |bounds.left| and |bounds.top| values are ignored. | 305 // |bounds.left| and |bounds.top| values are ignored. |
| 292 static void touchCalibrationSet(DOMString id, | 306 static void completeCustomTouchCalibration(TouchCalibrationPairQuad pairs, |
| 293 TouchCalibrationPairQuad pairs, | 307 Bounds bounds); |
| 294 Bounds bounds); | |
| 295 | 308 |
| 296 // Resets the touch calibration for the display and removes the saved | 309 // Resets the touch calibration for the display and brings it back to its |
| 297 // calibration data. | 310 // default state by clearing any touch calibration data associated with the |
| 311 // display. |
| 298 // |id|: The display's unique identifier. | 312 // |id|: The display's unique identifier. |
| 299 static void touchCalibrationReset(DOMString id); | 313 static void clearTouchCalibration(DOMString id); |
| 300 }; | 314 }; |
| 301 | 315 |
| 302 interface Events { | 316 interface Events { |
| 303 // Fired when anything changes to the display configuration. | 317 // Fired when anything changes to the display configuration. |
| 304 static void onDisplayChanged(); | 318 static void onDisplayChanged(); |
| 305 }; | 319 }; |
| 306 }; | 320 }; |
| OLD | NEW |