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

Side by Side Diff: remoting/webapp/base/js/base.js

Issue 918783002: CRD Viewport Management refactor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementation Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * A module that contains basic utility components and methods for the 7 * A module that contains basic utility components and methods for the
8 * chromoting project 8 * chromoting project
9 * 9 *
10 */ 10 */
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 src.addEventListener(eventName, listener); 519 src.addEventListener(eventName, listener);
520 }; 520 };
521 521
522 base.EventHook.prototype.dispose = function() { 522 base.EventHook.prototype.dispose = function() {
523 this.src_.removeEventListener(this.eventName_, this.listener_); 523 this.src_.removeEventListener(this.eventName_, this.listener_);
524 }; 524 };
525 525
526 /** 526 /**
527 * An event hook implementation for DOM Events. 527 * An event hook implementation for DOM Events.
528 * 528 *
529 * @param {HTMLElement} src 529 * @param {HTMLElement|Element} src
530 * @param {string} eventName 530 * @param {string} eventName
531 * @param {function(...?)} listener 531 * @param {function(...?)} listener
532 * @param {boolean} capture 532 * @param {boolean} capture
533 * 533 *
534 * @constructor 534 * @constructor
535 * @implements {base.Disposable} 535 * @implements {base.Disposable}
536 */ 536 */
537 base.DomEventHook = function(src, eventName, listener, capture) { 537 base.DomEventHook = function(src, eventName, listener, capture) {
538 this.src_ = src; 538 this.src_ = src;
539 this.eventName_ = eventName; 539 this.eventName_ = eventName;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 */ 621 */
622 base.resizeWindowToContent = function() { 622 base.resizeWindowToContent = function() {
623 var appWindow = chrome.app.window.current(); 623 var appWindow = chrome.app.window.current();
624 var outerBounds = appWindow.outerBounds; 624 var outerBounds = appWindow.outerBounds;
625 var borderY = outerBounds.height - appWindow.innerBounds.height; 625 var borderY = outerBounds.height - appWindow.innerBounds.height;
626 appWindow.resizeTo(outerBounds.width, document.body.clientHeight + borderY); 626 appWindow.resizeTo(outerBounds.width, document.body.clientHeight + borderY);
627 // Sometimes, resizing the window causes its position to be reset to (0, 0), 627 // Sometimes, resizing the window causes its position to be reset to (0, 0),
628 // so restore it explicitly. 628 // so restore it explicitly.
629 appWindow.moveTo(outerBounds.left, outerBounds.top); 629 appWindow.moveTo(outerBounds.left, outerBounds.top);
630 }; 630 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698