| 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 25 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |