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

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: Fix win 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..b0600f4972c20a97a8da071fbdb40de89a9561b8 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,18 @@ namespace system.display {
};
callback DisplayInfoCallback = void (DisplayUnitInfo[] displayInfo);
+ callback DisplayLayoutCallback = void (DisplayLayout[] layouts);
callback SetDisplayUnitInfoCallback = void();
+ callback SetDisplayLayoutCallback = 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 +199,19 @@ 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.
+ // NOTE: This is only available to Chrome OS Kiosk apps and Web UI.
+ // |layouts|: The layout information, required for all displays except
+ // the primary display.
+ // |callback|: Empty function called when the function finishes. To find out
+ // whether the function succeeded, $(ref:runtime.lastError) should be
+ // queried.
+ static void setDisplayLayout(DisplayLayout[] layouts,
+ optional SetDisplayLayoutCallback callback);
+
// 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)
« no previous file with comments | « extensions/browser/extension_function_histogram_value.h ('k') | extensions/test/data/system/display/info/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698