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

Side by Side Diff: remoting/webapp/crd/js/fullscreen_v2.js

Issue 875583002: Allow full-screen mode when not connected, and remember the previous setting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 * 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 25 matching lines...) Expand all
36 * @type {base.EventSource} 36 * @type {base.EventSource}
37 * @private 37 * @private
38 */ 38 */
39 this.eventSource_ = new base.EventSource(); 39 this.eventSource_ = new base.EventSource();
40 this.eventSource_.defineEvents([this.kEventName_]); 40 this.eventSource_.defineEvents([this.kEventName_]);
41 41
42 chrome.app.window.current().onFullscreened.addListener( 42 chrome.app.window.current().onFullscreened.addListener(
43 this.onFullscreened_.bind(this)); 43 this.onFullscreened_.bind(this));
44 chrome.app.window.current().onRestored.addListener( 44 chrome.app.window.current().onRestored.addListener(
45 this.onRestored_.bind(this)); 45 this.onRestored_.bind(this));
46
47 document.body.classList.toggle('fullscreen', this.isActive());
46 }; 48 };
47 49
48 remoting.FullscreenAppsV2.prototype.activate = function( 50 remoting.FullscreenAppsV2.prototype.activate = function(
49 fullscreen, opt_onDone) { 51 fullscreen, opt_onDone) {
50 if (opt_onDone) { 52 if (opt_onDone) {
51 if (this.isActive() == fullscreen) { 53 if (this.isActive() == fullscreen) {
52 opt_onDone(); 54 opt_onDone();
53 } else { 55 } else {
54 /** @type {remoting.Fullscreen} */ 56 /** @type {remoting.Fullscreen} */
55 var that = this; 57 var that = this;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 document.body.classList.add('fullscreen'); 98 document.body.classList.add('fullscreen');
97 }; 99 };
98 100
99 remoting.FullscreenAppsV2.prototype.onRestored_ = function() { 101 remoting.FullscreenAppsV2.prototype.onRestored_ = function() {
100 document.body.classList.remove('fullscreen'); 102 document.body.classList.remove('fullscreen');
101 if (this.notifyCallbacksOnRestore_) { 103 if (this.notifyCallbacksOnRestore_) {
102 this.notifyCallbacksOnRestore_ = false; 104 this.notifyCallbacksOnRestore_ = false;
103 this.eventSource_.raiseEvent(this.kEventName_, false); 105 this.eventSource_.raiseEvent(this.kEventName_, false);
104 } 106 }
105 }; 107 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698