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

Side by Side Diff: chrome/browser/resources/options2/chromeos/display_options.js

Issue 10827317: Refleshes display info when the chrome://settings/display dialog gets visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« 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.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 $('display-options-toggle-mirroring').onclick = (function() { 50 $('display-options-toggle-mirroring').onclick = (function() {
51 this.mirroring_ = !this.mirroring_; 51 this.mirroring_ = !this.mirroring_;
52 chrome.send('setMirroring', [this.mirroring_]); 52 chrome.send('setMirroring', [this.mirroring_]);
53 }).bind(this); 53 }).bind(this);
54 54
55 $('display-options-apply').onclick = this.applyResult_.bind(this); 55 $('display-options-apply').onclick = this.applyResult_.bind(this);
56 chrome.send('getDisplayInfo'); 56 chrome.send('getDisplayInfo');
57 }, 57 },
58 58
59 /** @override */
60 onVisibilityChanged_: function() {
61 OptionsPage.prototype.onVisibilityChanged_(this);
62 if (this.visible)
63 chrome.send('getDisplayInfo');
64 },
65
59 /** 66 /**
60 * Collects the current data and sends it to Chrome. 67 * Collects the current data and sends it to Chrome.
61 * @private 68 * @private
62 */ 69 */
63 applyResult_: function() { 70 applyResult_: function() {
64 // Offset is calculated from top or left edge. 71 // Offset is calculated from top or left edge.
65 var primary = this.displays_[0]; 72 var primary = this.displays_[0];
66 var secondary = this.displays_[1]; 73 var secondary = this.displays_[1];
67 var offset; 74 var offset;
68 if (this.layout_ == SecondaryDisplayLayout.LEFT || 75 if (this.layout_ == SecondaryDisplayLayout.LEFT ||
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 mirroring, displays, layout, offset) { 445 mirroring, displays, layout, offset) {
439 DisplayOptions.getInstance().onDisplayChanged_( 446 DisplayOptions.getInstance().onDisplayChanged_(
440 mirroring, displays, layout, offset); 447 mirroring, displays, layout, offset);
441 }; 448 };
442 449
443 // Export 450 // Export
444 return { 451 return {
445 DisplayOptions: DisplayOptions 452 DisplayOptions: DisplayOptions
446 }; 453 };
447 }); 454 });
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