Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: extensions/common/api/system_display.idl

Issue 2072633002: Add Get/SetDisplayLayout to chrome.system.display extension API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/common/api/system_display.idl
diff --git a/extensions/common/api/system_display.idl b/extensions/common/api/system_display.idl
index 31fe79c6e97ae7522f0578a9d999d9453f14652b..bc022d8f6588698d1a82b49dac3eb70a699d8a1c 100644
--- a/extensions/common/api/system_display.idl
+++ b/extensions/common/api/system_display.idl
@@ -59,6 +59,25 @@ namespace system.display {
boolean isSelected;
};
+ // Layout position, i.e. edge of parent that the display is attached to.
+ enum LayoutPosition { top, right, bottom, left };
+
+ dictionary DisplayLayout {
+ // The unique identifier of the display.
+ DOMString id;
+
+ // The unique identifier of the parent display. Empty if this is the root.
+ DOMString parentId;
+
+ // The layout position of this display relative to the parent. This will
+ // be ignored for the root.
+ LayoutPosition position;
+
+ // The offset of the display along the connected edge. 0 indicates that
+ // the topmost or leftmost corners are aligned.
+ long offset;
+ };
+
dictionary DisplayUnitInfo {
// The unique identifier of the display.
DOMString id;
@@ -152,12 +171,17 @@ namespace system.display {
};
callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo);
+ callback DisplayLayoutCallback = void (DisplayLayout[] layouts);
callback SetDisplayUnitInfoCallback = void();
interface Functions {
// Get the information of all attached display devices.
static void getInfo(DisplayInfoCallback callback);
+ // Get the layout info for all displays.
+ // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
+ static void getDisplayLayout(DisplayLayoutCallback callback);
+
// Updates the properties for the display specified by |id|, according to
// the information provided in |info|. On failure, $(ref:runtime.lastError)
// will be set.
@@ -174,6 +198,12 @@ namespace system.display {
DisplayProperties info,
optional SetDisplayUnitInfoCallback callback);
+ // Set the layout for all displays. Any display not included will use the
+ // default layout. If a layout would overlap or be otherwise invalid it
+ // will be adjusted to a valid layout. After layout is resolved, an
+ // onDisplayChanged event will be triggered.
+ static void setDisplayLayout(DisplayLayout[] layouts);
asargent_no_longer_on_chrome 2016/06/16 19:08:30 optional: you might consider adding a callback whi
stevenjb 2016/06/17 01:34:59 I don't want to add too much complexity to the API
+
// Enables/disables the unified desktop feature. Note that this simply
// enables the feature, but will not change the actual desktop mode.
// (That is, if the desktop is in mirror mode, it will stay in mirror mode)

Powered by Google App Engine
This is Rietveld 408576698