Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / remoting / webapp / crd / js / fullscreen.js
blob1dfff4f227bd46c0cd9ab2dc8389ab709c2a27b9
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
3 // found in the LICENSE file.
5 /**
6  * @fileoverview
7  * Controller interface for full-screen mode.
8  */
10 'use strict';
12 /** @suppress {duplicate} */
13 var remoting = remoting || {};
15 /** @interface */
16 remoting.Fullscreen = function() { };
18 /**
19  * Enter or leave full-screen mode.
20  *
21  * @param {boolean} fullscreen True to enter full-screen mode; false to leave.
22  * @param {function():void=} opt_onDone Optional completion callback.
23  */
24 remoting.Fullscreen.prototype.activate = function(fullscreen, opt_onDone) { };
26 /**
27  * @return {boolean} True if full-screen mode is active.
28  */
29 remoting.Fullscreen.prototype.isActive = function() { };
31 /**
32  * Toggle full-screen mode.
33  * @return {void}
34  */
35 remoting.Fullscreen.prototype.toggle = function() { };
37 /**
38  * Add a listener for the full-screen-changed event.
39  *
40  * @param {function(boolean=):void} callback
41  */
42 remoting.Fullscreen.prototype.addListener = function(callback) { };
44 /**
45  * Remove a listener for the full-screen-changed event.
46  *
47  * @param {function(boolean=):void} callback
48  */
49 remoting.Fullscreen.prototype.removeListener = function(callback) { };
51 /** @type {remoting.Fullscreen} */
52 remoting.fullscreen = null;
55 /**
56  * @constructor
57  * @param {function(boolean=)} listener
58  * @implements {base.Disposable}
59  */
60 remoting.Fullscreen.EventHook = function(listener) {
61   /** @private */
62   this.src_ = remoting.fullscreen;
63   /** @private */
64   this.listener_ = listener;
66   this.src_.addListener(listener);
69 remoting.Fullscreen.EventHook.prototype.dispose = function() {
70   this.src_.removeListener(this.listener_);