OLD | NEW |
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.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 | 7 |
8 // The scale ratio of the display rectangle to its original size. | 8 // The scale ratio of the display rectangle to its original size. |
9 /** @const */ var VISUAL_SCALE = 1 / 10; | 9 /** @const */ var VISUAL_SCALE = 1 / 10; |
10 | 10 |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 if (display.resolutions.length <= 1) { | 615 if (display.resolutions.length <= 1) { |
616 var option = document.createElement('option'); | 616 var option = document.createElement('option'); |
617 option.value = 'default'; | 617 option.value = 'default'; |
618 option.textContent = display.width + 'x' + display.height; | 618 option.textContent = display.width + 'x' + display.height; |
619 option.selected = true; | 619 option.selected = true; |
620 resolution.appendChild(option); | 620 resolution.appendChild(option); |
621 resolution.disabled = true; | 621 resolution.disabled = true; |
622 } else { | 622 } else { |
623 for (var i = 0; i < display.resolutions.length; i++) { | 623 for (var i = 0; i < display.resolutions.length; i++) { |
624 var option = document.createElement('option'); | 624 var option = document.createElement('option'); |
| 625 var width = display.resolutions[i].width; |
| 626 var height = display.resolutions[i].height; |
| 627 var scaleFactor = display.resolutions[i].scaleFactor; |
| 628 if (display.resolutions[i].scaleFactor) { |
| 629 width /= scaleFactor; |
| 630 height /= scaleFactor; |
| 631 } |
625 option.value = i; | 632 option.value = i; |
626 option.textContent = display.resolutions[i].width + 'x' + | 633 option.textContent = width + 'x' + height; |
627 display.resolutions[i].height; | 634 if (scaleFactor && scaleFactor > 1) |
| 635 option.textContent += '(x' + scaleFactor + ')'; |
628 if (display.resolutions[i].isBest) { | 636 if (display.resolutions[i].isBest) { |
629 option.textContent += ' ' + | 637 option.textContent += ' ' + |
630 loadTimeData.getString('annotateBest'); | 638 loadTimeData.getString('annotateBest'); |
631 } | 639 } |
632 option.selected = display.resolutions[i].selected; | 640 option.selected = display.resolutions[i].selected; |
633 resolution.appendChild(option); | 641 resolution.appendChild(option); |
634 } | 642 } |
635 resolution.disabled = (display.resolutions.length <= 1); | 643 resolution.disabled = (display.resolutions.length <= 1); |
636 } | 644 } |
637 | 645 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 mirroring, displays, layout, offset) { | 885 mirroring, displays, layout, offset) { |
878 DisplayOptions.getInstance().onDisplayChanged_( | 886 DisplayOptions.getInstance().onDisplayChanged_( |
879 mirroring, displays, layout, offset); | 887 mirroring, displays, layout, offset); |
880 }; | 888 }; |
881 | 889 |
882 // Export | 890 // Export |
883 return { | 891 return { |
884 DisplayOptions: DisplayOptions | 892 DisplayOptions: DisplayOptions |
885 }; | 893 }; |
886 }); | 894 }); |
OLD | NEW |