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

Unified Diff: remoting/webapp/crd/js/fullscreen_v1.js

Issue 803653004: Update Chromoting to use /third_party/closure_compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Define Entry for browser_tests Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
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..dc967684f93a25971166cbdfaf5030b5ede582e7 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,20 @@ remoting.FullscreenAppsV1.prototype.removeListener = function(callback) {
* @private
*/
remoting.FullscreenAppsV1.prototype.onFullscreenChanged_ = function() {
+ /** @this {remoting.FullscreenAppsV1} */
+ var checkIsActive = function() {
+ if (this.isActive()) {
+ document.body.classList.add('fullscreen');
+ } else {
+ document.body.classList.remove('fullscreen');
+ }
+ this.eventSource_.raiseEvent(this.kEventName_, this.isActive());
+ };
+
// 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()) {
- document.body.classList.add('fullscreen');
- } else {
- document.body.classList.remove('fullscreen');
- }
- this.eventSource_.raiseEvent(this.kEventName_, this.isActive());
- }.bind(this),
- 500);
+ window.setTimeout(checkIsActive.bind(this), 500);
};

Powered by Google App Engine
This is Rietveld 408576698