Index: chrome/browser/resources/settings/device_page/display.js |
diff --git a/chrome/browser/resources/settings/device_page/display.js b/chrome/browser/resources/settings/device_page/display.js |
index befaad8d52efce0f7c391af2065f990388d2be57..1a0539c5927697eb43c5eed5b5161ab775125ed5 100644 |
--- a/chrome/browser/resources/settings/device_page/display.js |
+++ b/chrome/browser/resources/settings/device_page/display.js |
@@ -32,6 +32,12 @@ Polymer({ |
displays: Array, |
/** |
+ * Array of display layouts. |
+ * @type {!Array<!chrome.system.display.DisplayLayout>} |
+ */ |
+ layouts: Array, |
+ |
+ /** |
* String listing the ids in displays. Used to observe changes to the |
* display configuration (i.e. when a display is added or removed). |
*/ |
@@ -107,6 +113,8 @@ Polymer({ |
getDisplayInfo_: function() { |
settings.display.systemDisplayApi.getInfo( |
this.updateDisplayInfo_.bind(this)); |
+ settings.display.systemDisplayApi.getDisplayLayout( |
+ this.updateDisplayLayout_.bind(this)); |
}, |
/** |
@@ -207,11 +215,15 @@ Polymer({ |
}, |
/** |
- * @param {!{model: !{index: number}, target: !PaperButtonElement}} e |
+ * @param {!{detail: number}} e |
* @private |
*/ |
- onSelectDisplayTap_: function(e) { |
- this.selectedDisplay = this.displays[e.model.index]; |
+ onSelectDisplay_: function(e) { |
+ var index = e.detail; |
+ assert(index >= 0); |
+ if (index >= this.displays.length) |
+ return; |
+ this.selectedDisplay = this.displays[e.detail]; |
// Force active in case selected display was clicked. |
e.target.active = true; |
}, |
@@ -313,6 +325,14 @@ Polymer({ |
(this.displays && this.displays[0]); |
}, |
+ /** |
+ * @param {!Array<!chrome.system.display.DisplayLayout>} layouts |
+ * @private |
+ */ |
+ updateDisplayLayout_(layouts) { |
+ this.layouts = layouts; |
+ }, |
+ |
/** @private */ |
setPropertiesCallback_: function() { |
if (chrome.runtime.lastError) { |