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

Unified Diff: chrome/browser/resources/settings/device_page/display.js

Issue 2084673003: MD Settings: Add display layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_547080_display_settings6
Patch Set: Feedback 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: 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..42013b9948fa2392a13038fe4431d6f3c46e5e68 100644
--- a/chrome/browser/resources/settings/device_page/display.js
+++ b/chrome/browser/resources/settings/device_page/display.js
@@ -5,8 +5,6 @@
/**
* @fileoverview
* 'settings-display' is the settings subpage for display settings.
- *
- * @group Chrome Settings Elements
*/
cr.define('settings.display', function() {
@@ -32,6 +30,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 +111,8 @@ Polymer({
getDisplayInfo_: function() {
settings.display.systemDisplayApi.getInfo(
this.updateDisplayInfo_.bind(this));
+ settings.display.systemDisplayApi.getDisplayLayout(
+ this.updateDisplayLayout_.bind(this));
},
/**
@@ -207,11 +213,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 +323,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) {

Powered by Google App Engine
This is Rietveld 408576698