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

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: Rebase Created 5 years, 10 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
« no previous file with comments | « remoting/webapp/crd/js/event_handlers.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 */ 46 */
47 this.eventSource_ = new base.EventSource(); 47 this.eventSource_ = new base.EventSource();
48 this.eventSource_.defineEvents([this.kEventName_]); 48 this.eventSource_.defineEvents([this.kEventName_]);
49 49
50 chrome.app.window.current().onFullscreened.addListener( 50 chrome.app.window.current().onFullscreened.addListener(
51 this.onFullscreened_.bind(this)); 51 this.onFullscreened_.bind(this));
52 chrome.app.window.current().onRestored.addListener( 52 chrome.app.window.current().onRestored.addListener(
53 this.onRestored_.bind(this)); 53 this.onRestored_.bind(this));
54 chrome.app.window.current().onMinimized.addListener( 54 chrome.app.window.current().onMinimized.addListener(
55 this.onMinimized_.bind(this)); 55 this.onMinimized_.bind(this));
56
57 document.body.classList.toggle('fullscreen', this.isActive());
56 }; 58 };
57 59
58 /** 60 /**
59 * @param {boolean} fullscreen True to enter full-screen mode; false to leave. 61 * @param {boolean} fullscreen True to enter full-screen mode; false to leave.
60 * @param {function():void=} opt_onDone Optional completion callback. 62 * @param {function():void=} opt_onDone Optional completion callback.
61 */ 63 */
62 remoting.FullscreenAppsV2.prototype.activate = function( 64 remoting.FullscreenAppsV2.prototype.activate = function(
63 fullscreen, opt_onDone) { 65 fullscreen, opt_onDone) {
64 if (opt_onDone) { 66 if (opt_onDone) {
65 if (this.isActive() == fullscreen) { 67 if (this.isActive() == fullscreen) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 /** 139 /**
138 * @param {boolean} isFullscreen 140 * @param {boolean} isFullscreen
139 * @private 141 * @private
140 */ 142 */
141 remoting.FullscreenAppsV2.prototype.raiseEvent_ = function(isFullscreen) { 143 remoting.FullscreenAppsV2.prototype.raiseEvent_ = function(isFullscreen) {
142 if (isFullscreen !== this.previousCallbackState_) { 144 if (isFullscreen !== this.previousCallbackState_) {
143 this.previousCallbackState_ = isFullscreen; 145 this.previousCallbackState_ = isFullscreen;
144 this.eventSource_.raiseEvent(this.kEventName_, isFullscreen); 146 this.eventSource_.raiseEvent(this.kEventName_, isFullscreen);
145 } 147 }
146 }; 148 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/event_handlers.js ('k') | remoting/webapp/crd/js/remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698