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 /** @type {remoting.HostSession} */ remoting.hostSession = null; | 10 /** @type {remoting.HostSession} */ remoting.hostSession = null; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 var htmlNode = /** @type {HTMLElement} */ (document.body.parentNode); | 45 var htmlNode = /** @type {HTMLElement} */ (document.body.parentNode); |
46 htmlNode.classList.add('apps-v2'); | 46 htmlNode.classList.add('apps-v2'); |
47 } else { | 47 } else { |
48 migrateLocalToChromeStorage_(); | 48 migrateLocalToChromeStorage_(); |
49 } | 49 } |
50 | 50 |
51 console.log(remoting.getExtensionInfo()); | 51 console.log(remoting.getExtensionInfo()); |
52 l10n.localize(); | 52 l10n.localize(); |
53 | 53 |
54 // Create global objects. | 54 // Create global objects. |
| 55 remoting.ClientPlugin.factory = new remoting.DefaultClientPluginFactory(); |
| 56 remoting.SessionConnector.factory = |
| 57 new remoting.DefaultSessionConnectorFactory(); |
55 remoting.settings = new remoting.Settings(); | 58 remoting.settings = new remoting.Settings(); |
56 if (base.isAppsV2()) { | 59 if (base.isAppsV2()) { |
57 remoting.identity = new remoting.Identity(consentRequired_); | 60 remoting.identity = new remoting.Identity(consentRequired_); |
58 remoting.fullscreen = new remoting.FullscreenAppsV2(); | 61 remoting.fullscreen = new remoting.FullscreenAppsV2(); |
59 remoting.windowFrame = new remoting.WindowFrame( | 62 remoting.windowFrame = new remoting.WindowFrame( |
60 document.getElementById('title-bar')); | 63 document.getElementById('title-bar')); |
61 } else { | 64 } else { |
62 remoting.oauth2 = new remoting.OAuth2(); | 65 remoting.oauth2 = new remoting.OAuth2(); |
63 if (!remoting.oauth2.isAuthenticated()) { | 66 if (!remoting.oauth2.isAuthenticated()) { |
64 document.getElementById('auth-dialog').hidden = false; | 67 document.getElementById('auth-dialog').hidden = false; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 191 } |
189 | 192 |
190 remoting.testEvents = new base.EventSource(); | 193 remoting.testEvents = new base.EventSource(); |
191 | 194 |
192 /** @enum {string} */ | 195 /** @enum {string} */ |
193 remoting.testEvents.Names = { | 196 remoting.testEvents.Names = { |
194 uiModeChanged: 'uiModeChanged' | 197 uiModeChanged: 'uiModeChanged' |
195 }; | 198 }; |
196 remoting.testEvents.defineEvents(base.values(remoting.testEvents.Names)); | 199 remoting.testEvents.defineEvents(base.values(remoting.testEvents.Names)); |
197 | 200 |
198 remoting.ClientPlugin.preload(); | 201 remoting.ClientPlugin.factory.preloadPlugin(); |
199 }; | 202 }; |
200 | 203 |
201 /** | 204 /** |
202 * Returns whether or not IT2Me is supported via the host NPAPI plugin. | 205 * Returns whether or not IT2Me is supported via the host NPAPI plugin. |
203 * | 206 * |
204 * @return {boolean} | 207 * @return {boolean} |
205 */ | 208 */ |
206 function isIT2MeSupported_() { | 209 function isIT2MeSupported_() { |
207 // Currently, IT2Me on Chromebooks is not supported. | 210 // Currently, IT2Me on Chromebooks is not supported. |
208 return !remoting.runningOnChromeOS(); | 211 return !remoting.runningOnChromeOS(); |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 587 } |
585 | 588 |
586 /** | 589 /** |
587 * Tests whether we are running on ChromeOS. | 590 * Tests whether we are running on ChromeOS. |
588 * | 591 * |
589 * @return {boolean} True if the platform is ChromeOS. | 592 * @return {boolean} True if the platform is ChromeOS. |
590 */ | 593 */ |
591 remoting.platformIsChromeOS = function() { | 594 remoting.platformIsChromeOS = function() { |
592 return navigator.userAgent.match(/\bCrOS\b/) != null; | 595 return navigator.userAgent.match(/\bCrOS\b/) != null; |
593 } | 596 } |
OLD | NEW |