| 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 eb4e56053e5874be9e1338f0afccdaae3990c010..d84da76b08d61caf72ee809e4048d411a8369d83 100644
|
| --- a/chrome/browser/resources/settings/device_page/display.js
|
| +++ b/chrome/browser/resources/settings/device_page/display.js
|
| @@ -70,6 +70,20 @@ Polymer({
|
|
|
| /** @private {!Array<number>} Mode index values for slider. */
|
| modeValues_: Array,
|
| +
|
| + /** @private */
|
| + unifiedDesktopAvailable_: {
|
| + type: Boolean,
|
| + value: function() {
|
| + return loadTimeData.getBoolean('unifiedDesktopAvailable');
|
| + }
|
| + },
|
| +
|
| + /** @private */
|
| + unifiedDesktopMode_: {
|
| + type: Boolean,
|
| + value: false,
|
| + },
|
| },
|
|
|
| /** @private {number} Selected mode index received from chrome. */
|
| @@ -240,17 +254,41 @@ Polymer({
|
| * @private
|
| */
|
| getDisplayMirrorText_: function(displays) {
|
| - return this.i18n(
|
| - this.isMirrored_(displays) ? 'displayMirrorOn' : 'displayMirrorOff');
|
| + return this.i18n(this.isMirrored_(displays) ? 'toggleOn' : 'toggleOff');
|
| },
|
|
|
| /**
|
| + * @param {boolean} unifiedDesktopAvailable
|
| + * @param {boolean} unifiedDesktopMode
|
| * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays
|
| * @return {boolean}
|
| * @private
|
| */
|
| - showMirror_: function(displays) {
|
| - return this.isMirrored_(displays) || displays.length == 2;
|
| + showUnifiedDesktop_: function(
|
| + unifiedDesktopAvailable, unifiedDesktopMode, displays) {
|
| + return unifiedDesktopMode ||
|
| + (unifiedDesktopAvailable && displays.length > 1 &&
|
| + !this.isMirrored_(displays));
|
| + },
|
| +
|
| + /**
|
| + * @param {boolean} unifiedDesktopMode
|
| + * @return {string}
|
| + * @private
|
| + */
|
| + getUnifiedDesktopText_: function(unifiedDesktopMode) {
|
| + return this.i18n(unifiedDesktopMode ? 'toggleOn' : 'toggleOff');
|
| + },
|
| +
|
| + /**
|
| + * @param {boolean} unifiedDesktopMode
|
| + * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays
|
| + * @return {boolean}
|
| + * @private
|
| + */
|
| + showMirror_: function(unifiedDesktopMode, displays) {
|
| + return this.isMirrored_(displays) ||
|
| + (!unifiedDesktopMode && displays.length == 2);
|
| },
|
|
|
| /**
|
| @@ -423,6 +461,12 @@ Polymer({
|
| id, properties, this.setPropertiesCallback_.bind(this));
|
| },
|
|
|
| + /** @private */
|
| + onUnifiedDesktopTap_: function() {
|
| + settings.display.systemDisplayApi.enableUnifiedDesktop(
|
| + !this.unifiedDesktopMode_);
|
| + },
|
| +
|
| /**
|
| * @param {!Event} e
|
| * @private
|
| @@ -454,6 +498,8 @@ Polymer({
|
| (this.displays && this.displays[0]);
|
| this.setSelectedDisplay_(selectedDisplay);
|
|
|
| + this.unifiedDesktopMode_ = !!primaryDisplay && primaryDisplay.isUnified;
|
| +
|
| this.$.displayLayout.updateDisplays(this.displays, this.layouts);
|
| },
|
|
|
|
|