| Index: remoting/webapp/crd/js/fullscreen_v1.js
|
| diff --git a/remoting/webapp/crd/js/fullscreen_v1.js b/remoting/webapp/crd/js/fullscreen_v1.js
|
| index a68a77bc27cbed2ec3f5c3db9f59bd868de01769..5f71a877dd21623875e414dd883348793ceb2e35 100644
|
| --- a/remoting/webapp/crd/js/fullscreen_v1.js
|
| +++ b/remoting/webapp/crd/js/fullscreen_v1.js
|
| @@ -59,18 +59,28 @@ remoting.FullscreenAppsV1.prototype.activate = function(
|
| }
|
| };
|
|
|
| +/** @return {void} */
|
| remoting.FullscreenAppsV1.prototype.toggle = function() {
|
| this.activate(!this.isActive());
|
| };
|
|
|
| +/**
|
| + * @return {boolean} True if full-screen mode is active.
|
| + */
|
| remoting.FullscreenAppsV1.prototype.isActive = function() {
|
| return document.webkitIsFullScreen;
|
| };
|
|
|
| +/**
|
| + * @param {function(boolean=):void} callback
|
| + */
|
| remoting.FullscreenAppsV1.prototype.addListener = function(callback) {
|
| this.eventSource_.addEventListener(this.kEventName_, callback);
|
| };
|
|
|
| +/**
|
| + * @param {function(boolean=):void} callback
|
| + */
|
| remoting.FullscreenAppsV1.prototype.removeListener = function(callback) {
|
| this.eventSource_.removeEventListener(this.kEventName_, callback);
|
| };
|
| @@ -79,20 +89,21 @@ remoting.FullscreenAppsV1.prototype.removeListener = function(callback) {
|
| * @private
|
| */
|
| remoting.FullscreenAppsV1.prototype.onFullscreenChanged_ = function() {
|
| + /** @type {remoting.FullscreenAppsV1} */
|
| + var that = this;
|
| // Querying full-screen immediately after the webkitfullscreenchange
|
| // event fires sometimes gives the wrong answer on Mac, perhaps due to
|
| // the time taken to animate presentation mode. Since I haven't been able
|
| // to isolate the exact repro steps, and we're not planning on using this
|
| // API for much longer, this hack will suffice for now.
|
| window.setTimeout(
|
| - /** @this {remoting.FullscreenAppsV1} */
|
| function() {
|
| - if (this.isActive()) {
|
| + if (that.isActive()) {
|
| document.body.classList.add('fullscreen');
|
| } else {
|
| document.body.classList.remove('fullscreen');
|
| }
|
| - this.eventSource_.raiseEvent(this.kEventName_, this.isActive());
|
| - }.bind(this),
|
| + that.eventSource_.raiseEvent(that.kEventName_, that.isActive());
|
| + }.bind(that),
|
| 500);
|
| };
|
|
|