OLD | NEW |
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 * Full-screen implementation for apps v2, using chrome.AppWindow. | 7 * Full-screen implementation for apps v2, using chrome.AppWindow. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 }; | 69 }; |
70 | 70 |
71 remoting.FullscreenAppsV2.prototype.toggle = function() { | 71 remoting.FullscreenAppsV2.prototype.toggle = function() { |
72 this.activate(!this.isActive()); | 72 this.activate(!this.isActive()); |
73 }; | 73 }; |
74 | 74 |
75 remoting.FullscreenAppsV2.prototype.isActive = function() { | 75 remoting.FullscreenAppsV2.prototype.isActive = function() { |
76 return chrome.app.window.current().isFullscreen(); | 76 return chrome.app.window.current().isFullscreen(); |
77 }; | 77 }; |
78 | 78 |
| 79 /** |
| 80 * @param {function(boolean=):void} callback |
| 81 */ |
79 remoting.FullscreenAppsV2.prototype.addListener = function(callback) { | 82 remoting.FullscreenAppsV2.prototype.addListener = function(callback) { |
80 this.eventSource_.addEventListener(this.kEventName_, callback); | 83 this.eventSource_.addEventListener(this.kEventName_, callback); |
81 }; | 84 }; |
82 | 85 |
| 86 /** |
| 87 * @param {function(boolean=):void} callback |
| 88 */ |
83 remoting.FullscreenAppsV2.prototype.removeListener = function(callback) { | 89 remoting.FullscreenAppsV2.prototype.removeListener = function(callback) { |
84 this.eventSource_.removeEventListener(this.kEventName_, callback); | 90 this.eventSource_.removeEventListener(this.kEventName_, callback); |
85 }; | 91 }; |
86 | 92 |
87 remoting.FullscreenAppsV2.prototype.onFullscreened_ = function() { | 93 remoting.FullscreenAppsV2.prototype.onFullscreened_ = function() { |
88 this.notifyCallbacksOnRestore_ = true; | 94 this.notifyCallbacksOnRestore_ = true; |
89 this.eventSource_.raiseEvent(this.kEventName_, true); | 95 this.eventSource_.raiseEvent(this.kEventName_, true); |
90 document.body.classList.add('fullscreen'); | 96 document.body.classList.add('fullscreen'); |
91 }; | 97 }; |
92 | 98 |
93 remoting.FullscreenAppsV2.prototype.onRestored_ = function() { | 99 remoting.FullscreenAppsV2.prototype.onRestored_ = function() { |
94 document.body.classList.remove('fullscreen'); | 100 document.body.classList.remove('fullscreen'); |
95 if (this.notifyCallbacksOnRestore_) { | 101 if (this.notifyCallbacksOnRestore_) { |
96 this.notifyCallbacksOnRestore_ = false; | 102 this.notifyCallbacksOnRestore_ = false; |
97 this.eventSource_.raiseEvent(this.kEventName_, false); | 103 this.eventSource_.raiseEvent(this.kEventName_, false); |
98 } | 104 } |
99 }; | 105 }; |
OLD | NEW |