Chromium Code Reviews| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 | 122 |
| 123 // True if this is the primary display. | 123 // True if this is the primary display. |
| 124 boolean isPrimary; | 124 boolean isPrimary; |
| 125 | 125 |
| 126 // True if this is an internal display. | 126 // True if this is an internal display. |
| 127 boolean isInternal; | 127 boolean isInternal; |
| 128 | 128 |
| 129 // True if this display is enabled. | 129 // True if this display is enabled. |
| 130 boolean isEnabled; | 130 boolean isEnabled; |
| 131 | 131 |
| 132 // True for all displays when in unified desktop mode. See documentation | |
| 133 // for $(ref:enableUnifiedDesktop). | |
| 134 boolean isUnified; | |
| 135 | |
| 132 // The number of pixels per inch along the x-axis. | 136 // The number of pixels per inch along the x-axis. |
| 133 double dpiX; | 137 double dpiX; |
| 134 | 138 |
| 135 // The number of pixels per inch along the y-axis. | 139 // The number of pixels per inch along the y-axis. |
| 136 double dpiY; | 140 double dpiY; |
| 137 | 141 |
| 138 // The display's clockwise rotation in degrees relative to the vertical | 142 // The display's clockwise rotation in degrees relative to the vertical |
| 139 // position. | 143 // position. |
| 140 // Currently exposed only on ChromeOS. Will be set to 0 on other platforms. | 144 // Currently exposed only on ChromeOS. Will be set to 0 on other platforms. |
| 141 long rotation; | 145 long rotation; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 156 // The list of available display modes. The current mode will have | 160 // The list of available display modes. The current mode will have |
| 157 // isSelected=true. Only available on Chrome OS. Will be set to an empty | 161 // isSelected=true. Only available on Chrome OS. Will be set to an empty |
| 158 // array on other platforms. | 162 // array on other platforms. |
| 159 DisplayMode[] modes; | 163 DisplayMode[] modes; |
| 160 | 164 |
| 161 // True if this display has a touch input device associated with it. | 165 // True if this display has a touch input device associated with it. |
| 162 boolean hasTouchSupport; | 166 boolean hasTouchSupport; |
| 163 }; | 167 }; |
| 164 | 168 |
| 165 dictionary DisplayProperties { | 169 dictionary DisplayProperties { |
| 170 // Chrome OS only. If set to true, changes the display mode to unifed | |
| 171 // desktop (see $(ref:enableUnifiedDesktop) for details). This is only valid | |
| 172 // for the primary display. If set, mirroringSourceId must not be set and | |
| 173 // other properties may not apply. | |
|
Devlin
2017/04/11 18:54:08
Comment what the default is.
stevenjb
2017/04/11 19:34:47
Done.
| |
| 174 boolean? isUnified; | |
| 175 | |
| 166 // Chrome OS only. If set and not empty, enables mirroring for this display. | 176 // Chrome OS only. If set and not empty, enables mirroring for this display. |
| 167 // Otherwise disables mirroring for this display. This value should indicate | 177 // Otherwise disables mirroring for this display. This value should indicate |
| 168 // the id of the source display to mirror, which must not be the same as the | 178 // the id of the source display to mirror, which must not be the same as the |
| 169 // id passed to setDisplayProperties. If set, no other property may be set. | 179 // id passed to setDisplayProperties. If set, no other property may be set. |
| 170 DOMString? mirroringSourceId; | 180 DOMString? mirroringSourceId; |
| 171 | 181 |
| 172 // If set to true, makes the display primary. No-op if set to false. | 182 // If set to true, makes the display primary. No-op if set to false. |
| 173 boolean? isPrimary; | 183 boolean? isPrimary; |
| 174 | 184 |
| 175 // If set, sets the display's overscan insets to the provided values. Note | 185 // If set, sets the display's overscan insets to the provided values. Note |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 196 long? boundsOriginX; | 206 long? boundsOriginX; |
| 197 | 207 |
| 198 // If set, updates the display's logical bounds origin along y-axis. | 208 // If set, updates the display's logical bounds origin along y-axis. |
| 199 // See documentation for <code>boundsOriginX</code> parameter. | 209 // See documentation for <code>boundsOriginX</code> parameter. |
| 200 long? boundsOriginY; | 210 long? boundsOriginY; |
| 201 | 211 |
| 202 // If set, updates the display mode to the mode matching this value. | 212 // If set, updates the display mode to the mode matching this value. |
| 203 DisplayMode? displayMode; | 213 DisplayMode? displayMode; |
| 204 }; | 214 }; |
| 205 | 215 |
| 216 dictionary GetInfoFlags { | |
| 217 // If set to true, only a single $(ref:DisplayUnitInfo) will be returned | |
| 218 // by $(ref:getInfo) when in unified desktop mode (see | |
| 219 // $(ref:enableUnifiedDesktop)). | |
|
Devlin
2017/04/11 18:54:08
Comment also what the default is.
stevenjb
2017/04/11 19:34:47
Done.
| |
| 220 boolean? singleUnified; | |
|
Devlin
2017/04/11 18:54:08
singleUnified seems redundant to me - maybe single
stevenjb
2017/04/11 19:34:47
single = one result, unified = when in unified des
| |
| 221 }; | |
| 222 | |
| 206 callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo); | 223 callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo); |
| 207 callback DisplayLayoutCallback = void (DisplayLayout[] layouts); | 224 callback DisplayLayoutCallback = void (DisplayLayout[] layouts); |
| 208 callback SetDisplayUnitInfoCallback = void(); | 225 callback SetDisplayUnitInfoCallback = void(); |
| 209 callback SetDisplayLayoutCallback = void(); | 226 callback SetDisplayLayoutCallback = void(); |
| 210 callback NativeTouchCalibrationCallback = void(boolean success); | 227 callback NativeTouchCalibrationCallback = void(boolean success); |
| 211 | 228 |
| 212 interface Functions { | 229 interface Functions { |
| 213 // Get the information of all attached display devices. | 230 // Requests the information for all attached display devices. |
| 214 static void getInfo(DisplayInfoCallback callback); | 231 // |flags|: See $(ref:GetInfoFlags). |
|
Devlin
2017/04/11 18:54:08
similar to the others, |flags| will already have a
stevenjb
2017/04/11 19:34:47
Done.
| |
| 232 // |callback|: This will be invoked with an array of $(ref:DisplayUnitInfo). | |
|
Devlin
2017/04/11 18:54:08
same as 238 (sorry, wrote these backwards)
stevenjb
2017/04/11 19:34:47
Done.
| |
| 233 static void getInfo(optional GetInfoFlags flags, | |
| 234 DisplayInfoCallback callback); | |
| 215 | 235 |
| 216 // Get the layout info for all displays. | 236 // Requests the layout info for all displays. |
| 217 // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. | 237 // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. |
| 238 // |callback|: This will be invoked with an array of $(ref:DisplayLayout). | |
|
Devlin
2017/04/11 18:54:08
The docs already say this by virtue of what the ca
stevenjb
2017/04/11 19:34:47
Done.
| |
| 218 static void getDisplayLayout(DisplayLayoutCallback callback); | 239 static void getDisplayLayout(DisplayLayoutCallback callback); |
| 219 | 240 |
| 220 // Updates the properties for the display specified by |id|, according to | 241 // Updates the properties for the display specified by |id|, according to |
| 221 // the information provided in |info|. On failure, $(ref:runtime.lastError) | 242 // the information provided in |info|. On failure, $(ref:runtime.lastError) |
| 222 // will be set. | 243 // will be set. |
| 223 // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. | 244 // NOTE: This is only available to Chrome OS Kiosk apps and Web UI. |
| 224 // |id|: The display's unique identifier. | 245 // |id|: The display's unique identifier. |
| 225 // |info|: The information about display properties that should be changed. | 246 // |info|: The information about display properties that should be changed. |
| 226 // A property will be changed only if a new value for it is specified in | 247 // A property will be changed only if a new value for it is specified in |
| 227 // |info|. | 248 // |info|. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 // display. | 332 // display. |
| 312 // |id|: The display's unique identifier. | 333 // |id|: The display's unique identifier. |
| 313 static void clearTouchCalibration(DOMString id); | 334 static void clearTouchCalibration(DOMString id); |
| 314 }; | 335 }; |
| 315 | 336 |
| 316 interface Events { | 337 interface Events { |
| 317 // Fired when anything changes to the display configuration. | 338 // Fired when anything changes to the display configuration. |
| 318 static void onDisplayChanged(); | 339 static void onDisplayChanged(); |
| 319 }; | 340 }; |
| 320 }; | 341 }; |
| OLD | NEW |