| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
| 8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * @type {base.EventSource} An event source object for handling global events. | 11 * @type {base.EventSource} An event source object for handling global events. |
| 12 * This is an interim hack. Eventually, we should move functionalities | 12 * This is an interim hack. Eventually, we should move functionalities |
| 13 * away from the remoting namespace and into smaller objects. | 13 * away from the remoting namespace and into smaller objects. |
| 14 */ | 14 */ |
| 15 remoting.testEvents; | 15 remoting.testEvents; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Initialization tasks that are common to all remoting apps. | 18 * Initialization tasks that are common to all remoting apps. |
| 19 */ | 19 */ |
| 20 remoting.initGlobalObjects = function() { | 20 remoting.initGlobalObjects = function() { |
| 21 if (base.isAppsV2()) { | 21 if (base.isAppsV2()) { |
| 22 var htmlNode = /** @type {HTMLElement} */ (document.body.parentNode); | 22 var htmlNode = /** @type {HTMLElement} */ (document.body.parentNode); |
| 23 htmlNode.classList.add('apps-v2'); | 23 htmlNode.classList.add('apps-v2'); |
| 24 } | 24 } |
| 25 | 25 |
| 26 console.log(remoting.getExtensionInfo()); | 26 console.log(remoting.getExtensionInfo()); |
| 27 l10n.localize(); | 27 l10n.localize(); |
| 28 | 28 |
| 29 if (base.isAppsV2()) { | |
| 30 remoting.fullscreen = new remoting.FullscreenAppsV2(); | |
| 31 } else { | |
| 32 remoting.fullscreen = new remoting.FullscreenAppsV1(); | |
| 33 } | |
| 34 | |
| 35 remoting.stats = new remoting.ConnectionStats( | 29 remoting.stats = new remoting.ConnectionStats( |
| 36 document.getElementById('statistics')); | 30 document.getElementById('statistics')); |
| 37 remoting.formatIq = new remoting.FormatIq(); | 31 remoting.formatIq = new remoting.FormatIq(); |
| 38 | 32 |
| 39 remoting.clipboard = new remoting.Clipboard(); | 33 remoting.clipboard = new remoting.Clipboard(); |
| 40 var sandbox = | 34 var sandbox = |
| 41 /** @type {HTMLIFrameElement} */ (document.getElementById('wcs-sandbox')); | 35 /** @type {HTMLIFrameElement} */ (document.getElementById('wcs-sandbox')); |
| 42 remoting.wcsSandbox = new remoting.WcsSandboxContainer(sandbox.contentWindow); | 36 remoting.wcsSandbox = new remoting.WcsSandboxContainer(sandbox.contentWindow); |
| 43 | 37 |
| 44 // The plugin's onFocus handler sends a paste command to |window|, because | 38 // The plugin's onFocus handler sends a paste command to |window|, because |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 chrome.windows.get(tab.windowId, null, windowCallback); | 216 chrome.windows.get(tab.windowId, null, windowCallback); |
| 223 } | 217 } |
| 224 }; | 218 }; |
| 225 if (chrome.tabs) { | 219 if (chrome.tabs) { |
| 226 chrome.tabs.getCurrent(tabCallback); | 220 chrome.tabs.getCurrent(tabCallback); |
| 227 } else { | 221 } else { |
| 228 console.error('chome.tabs is not available.'); | 222 console.error('chome.tabs is not available.'); |
| 229 } | 223 } |
| 230 } | 224 } |
| 231 | 225 |
| OLD | NEW |