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

Unified Diff: chrome/browser/resources/options/chromeos/display_options.js

Issue 1844783002: Only enable mirroring for 2 displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass mirrorEnabled explicitly, cleanup Created 4 years, 9 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/options/chromeos/display_options.js
diff --git a/chrome/browser/resources/options/chromeos/display_options.js b/chrome/browser/resources/options/chromeos/display_options.js
index ea6573cd9ae4ce6d3902912f8a82cb14bb32364e..9ffc820b39ef6b6c2551b21fd8a33006ae3dcb29 100644
--- a/chrome/browser/resources/options/chromeos/display_options.js
+++ b/chrome/browser/resources/options/chromeos/display_options.js
@@ -98,7 +98,14 @@ cr.define('options', function() {
* @type {boolean}
* @private
*/
- showUnifiedDesktopOption_: false,
+ unifiedEnabled_: false,
+
+ /**
+ * Whether the mirroring option should be present.
+ * @type {boolean}
+ * @private
+ */
+ mirroredEnabled_: false,
/**
* The array of current output displays. It also contains the display
@@ -233,17 +240,19 @@ cr.define('options', function() {
/**
* Enables or disables the page. When disabled, the page will not be able to
- * open, and will close if currently opened.
- * @param {boolean} enabled Whether the page should be enabled.
- * @param {boolean} showUnifiedDesktop Whether the unified desktop option
- * should be present.
+ * open, and will close if currently opened. Also sets the enabled states of
+ * mirrored and unifed desktop.
+ * @param {boolean} uiEnabled
+ * @param {boolean} unifiedEnabled
+ * @param {boolean} mirroredEnabled
*/
- setEnabled: function(enabled, showUnifiedDesktop) {
- this.showUnifiedDesktopOption_ = showUnifiedDesktop;
- if (this.enabled_ == enabled)
+ setEnabled: function(uiEnabled, unifiedEnabled, mirroredEnabled) {
+ this.unifiedEnabled_ = unifiedEnabled;
+ this.mirroredEnabled_ = mirroredEnabled;
+ if (this.enabled_ == uiEnabled)
return;
- this.enabled_ = enabled;
- if (!enabled && this.visible)
+ this.enabled_ = uiEnabled;
+ if (!uiEnabled && this.visible)
PageManager.closeOverlay();
},
@@ -481,8 +490,7 @@ cr.define('options', function() {
displayLayout.div.offsetWidth / 2 - arrow.offsetWidth / 2 + 'px';
$('display-options-set-primary').disabled = display.isPrimary;
- $('display-options-select-mirroring').disabled =
- (this.displays_.length <= 1 && !this.unifiedDesktopEnabled_);
+ $('display-options-select-mirroring').disabled = !this.mirroredEnabled_;
$('selected-display-start-calibrating-overscan').disabled =
display.isInternal;
@@ -694,8 +702,7 @@ cr.define('options', function() {
$('display-options-select-mirroring').value =
mirroring ? 'mirroring' : 'extended';
- $('display-options-unified-desktop').hidden =
- !this.showUnifiedDesktopOption_;
+ $('display-options-unified-desktop').hidden = !this.unifiedEnabled_;
$('display-options-toggle-unified-desktop').checked =
this.unifiedDesktopEnabled_;

Powered by Google App Engine
This is Rietveld 408576698