| 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 9ffc820b39ef6b6c2551b21fd8a33006ae3dcb29..2a12616c35713f589506a7bae60b1863e157fcd8 100644
|
| --- a/chrome/browser/resources/options/chromeos/display_options.js
|
| +++ b/chrome/browser/resources/options/chromeos/display_options.js
|
| @@ -69,9 +69,9 @@ cr.define('options', function() {
|
| * @extends {cr.ui.pageManager.Page}
|
| */
|
| function DisplayOptions() {
|
| - Page.call(this, 'display',
|
| - loadTimeData.getString('displayOptionsPageTabTitle'),
|
| - 'display-options-page');
|
| + Page.call(
|
| + this, 'display', loadTimeData.getString('displayOptionsPageTabTitle'),
|
| + 'display-options-page');
|
| }
|
|
|
| cr.addSingletonGetter(DisplayOptions);
|
| @@ -173,11 +173,12 @@ cr.define('options', function() {
|
| initializePage: function() {
|
| Page.prototype.initializePage.call(this);
|
|
|
| - $('display-options-select-mirroring').onchange = (function() {
|
| - this.mirroring_ =
|
| - $('display-options-select-mirroring').value == 'mirroring';
|
| - chrome.send('setMirroring', [this.mirroring_]);
|
| - }).bind(this);
|
| + $('display-options-select-mirroring').onchange =
|
| + (function() {
|
| + this.mirroring_ =
|
| + $('display-options-select-mirroring').value == 'mirroring';
|
| + chrome.send('setMirroring', [this.mirroring_]);
|
| + }).bind(this);
|
|
|
| var container = $('display-options-displays-view-host');
|
| container.onmousemove = this.onMouseMove_.bind(this);
|
| @@ -185,48 +186,54 @@ cr.define('options', function() {
|
| container.ontouchmove = this.onTouchMove_.bind(this);
|
| container.ontouchend = this.endDragging_.bind(this);
|
|
|
| - $('display-options-set-primary').onclick = (function() {
|
| - chrome.send('setPrimary', [this.focusedId_]);
|
| - }).bind(this);
|
| - $('display-options-resolution-selection').onchange = (function(ev) {
|
| - var display = this.getDisplayInfoFromId_(this.focusedId_);
|
| - if (!display)
|
| - return;
|
| - var resolution = display.resolutions[ev.target.value];
|
| - chrome.send('setDisplayMode', [this.focusedId_, resolution]);
|
| - }).bind(this);
|
| - $('display-options-orientation-selection').onchange = (function(ev) {
|
| - var rotation = parseInt(ev.target.value, 10);
|
| - chrome.send('setRotation', [this.focusedId_, rotation]);
|
| - }).bind(this);
|
| - $('display-options-color-profile-selection').onchange = (function(ev) {
|
| - chrome.send('setColorProfile', [this.focusedId_, ev.target.value]);
|
| - }).bind(this);
|
| - $('selected-display-start-calibrating-overscan').onclick = (function() {
|
| - // Passes the target display ID. Do not specify it through URL hash,
|
| - // we do not care back/forward.
|
| - var displayOverscan = options.DisplayOverscan.getInstance();
|
| - displayOverscan.setDisplayId(this.focusedId_);
|
| - PageManager.showPageByName('displayOverscan');
|
| - chrome.send('coreOptionsUserMetricsAction',
|
| - ['Options_DisplaySetOverscan']);
|
| - }).bind(this);
|
| + $('display-options-set-primary').onclick =
|
| + (function() {
|
| + chrome.send('setPrimary', [this.focusedId_]);
|
| + }).bind(this);
|
| + $('display-options-resolution-selection').onchange =
|
| + (function(ev) {
|
| + var display = this.getDisplayInfoFromId_(this.focusedId_);
|
| + if (!display)
|
| + return;
|
| + var resolution = display.resolutions[ev.target.value];
|
| + chrome.send('setDisplayMode', [this.focusedId_, resolution]);
|
| + }).bind(this);
|
| + $('display-options-orientation-selection').onchange =
|
| + (function(ev) {
|
| + var rotation = parseInt(ev.target.value, 10);
|
| + chrome.send('setRotation', [this.focusedId_, rotation]);
|
| + }).bind(this);
|
| + $('display-options-color-profile-selection').onchange =
|
| + (function(ev) {
|
| + chrome.send('setColorProfile', [this.focusedId_, ev.target.value]);
|
| + }).bind(this);
|
| + $('selected-display-start-calibrating-overscan').onclick =
|
| + (function() {
|
| + // Passes the target display ID. Do not specify it through URL hash,
|
| + // we do not care back/forward.
|
| + var displayOverscan = options.DisplayOverscan.getInstance();
|
| + displayOverscan.setDisplayId(this.focusedId_);
|
| + PageManager.showPageByName('displayOverscan');
|
| + chrome.send(
|
| + 'coreOptionsUserMetricsAction', ['Options_DisplaySetOverscan']);
|
| + }).bind(this);
|
|
|
| $('display-options-done').onclick = function() {
|
| PageManager.closeOverlay();
|
| };
|
|
|
| - $('display-options-toggle-unified-desktop').onclick = (function() {
|
| - this.unifiedDesktopEnabled_ = !this.unifiedDesktopEnabled_;
|
| - chrome.send('setUnifiedDesktopEnabled',
|
| - [this.unifiedDesktopEnabled_]);
|
| - }).bind(this);
|
| + $('display-options-toggle-unified-desktop').onclick =
|
| + (function() {
|
| + this.unifiedDesktopEnabled_ = !this.unifiedDesktopEnabled_;
|
| + chrome.send(
|
| + 'setUnifiedDesktopEnabled', [this.unifiedDesktopEnabled_]);
|
| + }).bind(this);
|
| },
|
|
|
| /** @override */
|
| didShowPage: function() {
|
| - var optionTitles = document.getElementsByClassName(
|
| - 'selected-display-option-title');
|
| + var optionTitles =
|
| + document.getElementsByClassName('selected-display-option-title');
|
| var maxSize = 0;
|
| for (var i = 0; i < optionTitles.length; i++)
|
| maxSize = Math.max(maxSize, optionTitles[i].clientWidth);
|
| @@ -236,7 +243,9 @@ cr.define('options', function() {
|
| },
|
|
|
| /** @override */
|
| - canShowPage: function() { return this.enabled_; },
|
| + canShowPage: function() {
|
| + return this.enabled_;
|
| + },
|
|
|
| /**
|
| * Enables or disables the page. When disabled, the page will not be able to
|
| @@ -397,10 +406,8 @@ cr.define('options', function() {
|
| if (this.displayLayoutManager_.getDisplayLayoutCount() > 1) {
|
| this.dragInfo_ = {
|
| displayId: focused.id,
|
| - originalLocation: {
|
| - x: focused.div.offsetLeft,
|
| - y: focused.div.offsetTop
|
| - },
|
| + originalLocation:
|
| + {x: focused.div.offsetLeft, y: focused.div.offsetTop},
|
| eventLocation: {x: eventLocation.x, y: eventLocation.y}
|
| };
|
| }
|
| @@ -484,8 +491,8 @@ cr.define('options', function() {
|
| arrow.hidden = false;
|
| // Adding 1 px to the position to fit the border line and the border in
|
| // arrow precisely.
|
| - arrow.style.top = $('display-configurations').offsetTop -
|
| - arrow.offsetHeight / 2 + 'px';
|
| + arrow.style.top =
|
| + $('display-configurations').offsetTop - arrow.offsetHeight / 2 + 'px';
|
| arrow.style.left = displayLayout.div.offsetLeft +
|
| displayLayout.div.offsetWidth / 2 - arrow.offsetWidth / 2 + 'px';
|
|
|
| @@ -519,11 +526,10 @@ cr.define('options', function() {
|
| option.textContent = display.resolutions[i].width + 'x' +
|
| display.resolutions[i].height;
|
| if (display.resolutions[i].isBest) {
|
| - option.textContent += ' ' +
|
| - loadTimeData.getString('annotateBest');
|
| + option.textContent += ' ' + loadTimeData.getString('annotateBest');
|
| } else if (display.resolutions[i].isNative) {
|
| - option.textContent += ' ' +
|
| - loadTimeData.getString('annotateNative');
|
| + option.textContent +=
|
| + ' ' + loadTimeData.getString('annotateNative');
|
| }
|
| if (display.resolutions[i].deviceScaleFactor && previousOption &&
|
| previousOption.textContent == option.textContent) {
|
| @@ -657,7 +663,7 @@ cr.define('options', function() {
|
|
|
| // Calculate the display area bounds and create the divs for each display.
|
| this.visualScale_ = this.displayLayoutManager_.createDisplayArea(
|
| - /** @type {!Element} */(this.displaysView_), VISUAL_SCALE);
|
| + /** @type {!Element} */ (this.displaysView_), VISUAL_SCALE);
|
|
|
| this.displayLayoutManager_.setFocusedId(this.focusedId_);
|
| this.displayLayoutManager_.setDivCallbacks(
|
| @@ -723,7 +729,5 @@ cr.define('options', function() {
|
| };
|
|
|
| // Export
|
| - return {
|
| - DisplayOptions: DisplayOptions
|
| - };
|
| + return {DisplayOptions: DisplayOptions};
|
| });
|
|
|