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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 }; |
OLD | NEW |