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

Side by Side 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: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.exportPath('options'); 5 cr.exportPath('options');
6 6
7 /** 7 /**
8 * Enumeration of multi display mode. These values must match the C++ values in 8 * Enumeration of multi display mode. These values must match the C++ values in
9 * ash::DisplayManager. 9 * ash::DisplayManager.
10 * @enum {number} 10 * @enum {number}
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 var arrow = $('display-configuration-arrow'); 474 var arrow = $('display-configuration-arrow');
475 arrow.hidden = false; 475 arrow.hidden = false;
476 // Adding 1 px to the position to fit the border line and the border in 476 // Adding 1 px to the position to fit the border line and the border in
477 // arrow precisely. 477 // arrow precisely.
478 arrow.style.top = $('display-configurations').offsetTop - 478 arrow.style.top = $('display-configurations').offsetTop -
479 arrow.offsetHeight / 2 + 'px'; 479 arrow.offsetHeight / 2 + 'px';
480 arrow.style.left = displayLayout.div.offsetLeft + 480 arrow.style.left = displayLayout.div.offsetLeft +
481 displayLayout.div.offsetWidth / 2 - arrow.offsetWidth / 2 + 'px'; 481 displayLayout.div.offsetWidth / 2 - arrow.offsetWidth / 2 + 'px';
482 482
483 $('display-options-set-primary').disabled = display.isPrimary; 483 $('display-options-set-primary').disabled = display.isPrimary;
484 $('display-options-select-mirroring').disabled = 484
485 (this.displays_.length <= 1 && !this.unifiedDesktopEnabled_); 485 // Mirroring is only supported for 2 displays.
486 var allowMirroring = this.displays_.length == 2;
487 if (this.unifiedDesktopEnabled_) {
488 // In unified desktop mode, there is only one display as far as the
489 // UI is concerned, but we want to allow the user to select mirroring
490 // (which will turn off unified mode).
491 allowMirroring = true;
oshima 2016/03/30 18:51:22 The original code was based on the assumption that
stevenjb 2016/03/30 19:03:30 I don't understand your suggestion. Do you want me
492 }
493 $('display-options-select-mirroring').disabled = !allowMirroring;
486 $('selected-display-start-calibrating-overscan').disabled = 494 $('selected-display-start-calibrating-overscan').disabled =
487 display.isInternal; 495 display.isInternal;
488 496
489 var orientation = $('display-options-orientation-selection'); 497 var orientation = $('display-options-orientation-selection');
490 orientation.disabled = this.unifiedDesktopEnabled_; 498 orientation.disabled = this.unifiedDesktopEnabled_;
491 499
492 var orientationOptions = orientation.getElementsByTagName('option'); 500 var orientationOptions = orientation.getElementsByTagName('option');
493 var orientationIndex = Math.floor(display.rotation / 90); 501 var orientationIndex = Math.floor(display.rotation / 90);
494 orientationOptions[orientationIndex].selected = true; 502 orientationOptions[orientationIndex].selected = true;
495 503
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 721
714 DisplayOptions.setDisplayInfo = function(mode, displays) { 722 DisplayOptions.setDisplayInfo = function(mode, displays) {
715 DisplayOptions.getInstance().onDisplayChanged_(mode, displays); 723 DisplayOptions.getInstance().onDisplayChanged_(mode, displays);
716 }; 724 };
717 725
718 // Export 726 // Export
719 return { 727 return {
720 DisplayOptions: DisplayOptions 728 DisplayOptions: DisplayOptions
721 }; 729 };
722 }); 730 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698