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

Side by Side Diff: chrome/browser/resources/settings/device_page/display.js

Issue 2824843002: MD Settings: Display: Disable orientaiton control in tablet mode (Closed)
Patch Set: Add test and trigger onDisplayChanged Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-display' is the settings subpage for display settings. 7 * 'settings-display' is the settings subpage for display settings.
8 */ 8 */
9 9
10 cr.define('settings.display', function() { 10 cr.define('settings.display', function() {
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 var widthStr = mode.width.toString(); 343 var widthStr = mode.width.toString();
344 var heightStr = mode.height.toString(); 344 var heightStr = mode.height.toString();
345 if (best) 345 if (best)
346 return this.i18n('displayResolutionTextBest', widthStr, heightStr); 346 return this.i18n('displayResolutionTextBest', widthStr, heightStr);
347 else if (mode.isNative) 347 else if (mode.isNative)
348 return this.i18n('displayResolutionTextNative', widthStr, heightStr); 348 return this.i18n('displayResolutionTextNative', widthStr, heightStr);
349 return this.i18n('displayResolutionText', widthStr, heightStr); 349 return this.i18n('displayResolutionText', widthStr, heightStr);
350 }, 350 },
351 351
352 /** 352 /**
353 * @param {!chrome.system.display.DisplayUnitInfo} selectedDisplay
354 * @return {boolean}
355 * @private
356 */
357 enableOrientation_: function(selectedDisplay) {
358 return !selectedDisplay.isMaximizeMode;
359 },
360
361 /**
353 * @param {!{detail: string}} e |e.detail| is the id of the selected display. 362 * @param {!{detail: string}} e |e.detail| is the id of the selected display.
354 * @private 363 * @private
355 */ 364 */
356 onSelectDisplay_: function(e) { 365 onSelectDisplay_: function(e) {
357 var id = e.detail; 366 var id = e.detail;
358 for (var i = 0; i < this.displays.length; ++i) { 367 for (var i = 0; i < this.displays.length; ++i) {
359 var display = this.displays[i]; 368 var display = this.displays[i];
360 if (id == display.id) { 369 if (id == display.id) {
361 if (this.selectedDisplay != display) 370 if (this.selectedDisplay != display)
362 this.setSelectedDisplay_(display); 371 this.setSelectedDisplay_(display);
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 }, 525 },
517 526
518 /** @private */ 527 /** @private */
519 setPropertiesCallback_: function() { 528 setPropertiesCallback_: function() {
520 if (chrome.runtime.lastError) { 529 if (chrome.runtime.lastError) {
521 console.error( 530 console.error(
522 'setDisplayProperties Error: ' + chrome.runtime.lastError.message); 531 'setDisplayProperties Error: ' + chrome.runtime.lastError.message);
523 } 532 }
524 }, 533 },
525 }); 534 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/device_page/display.html ('k') | extensions/common/api/system_display.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698