| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Create global objects. | 54 // Create global objects. |
| 55 remoting.ClientPlugin.factory = new remoting.DefaultClientPluginFactory(); | 55 remoting.ClientPlugin.factory = new remoting.DefaultClientPluginFactory(); |
| 56 remoting.SessionConnector.factory = | 56 remoting.SessionConnector.factory = |
| 57 new remoting.DefaultSessionConnectorFactory(); | 57 new remoting.DefaultSessionConnectorFactory(); |
| 58 remoting.settings = new remoting.Settings(); | 58 remoting.settings = new remoting.Settings(); |
| 59 if (base.isAppsV2()) { | 59 if (base.isAppsV2()) { |
| 60 remoting.identity = new remoting.Identity(consentRequired_); | 60 remoting.identity = new remoting.Identity(consentRequired_); |
| 61 remoting.fullscreen = new remoting.FullscreenAppsV2(); | 61 remoting.fullscreen = new remoting.FullscreenAppsV2(); |
| 62 remoting.windowFrame = new remoting.WindowFrame( | 62 remoting.windowFrame = new remoting.WindowFrame( |
| 63 document.getElementById('title-bar')); | 63 document.getElementById('title-bar')); |
| 64 remoting.optionsMenu = remoting.windowFrame.createOptionsMenu(); |
| 64 } else { | 65 } else { |
| 65 remoting.oauth2 = new remoting.OAuth2(); | 66 remoting.oauth2 = new remoting.OAuth2(); |
| 66 if (!remoting.oauth2.isAuthenticated()) { | 67 if (!remoting.oauth2.isAuthenticated()) { |
| 67 document.getElementById('auth-dialog').hidden = false; | 68 document.getElementById('auth-dialog').hidden = false; |
| 68 } | 69 } |
| 69 remoting.identity = remoting.oauth2; | 70 remoting.identity = remoting.oauth2; |
| 70 remoting.fullscreen = new remoting.FullscreenAppsV1(); | 71 remoting.fullscreen = new remoting.FullscreenAppsV1(); |
| 72 remoting.toolbar = new remoting.Toolbar( |
| 73 document.getElementById('session-toolbar')); |
| 74 remoting.optionsMenu = remoting.toolbar.createOptionsMenu(); |
| 71 } | 75 } |
| 72 remoting.stats = new remoting.ConnectionStats( | 76 remoting.stats = new remoting.ConnectionStats( |
| 73 document.getElementById('statistics')); | 77 document.getElementById('statistics')); |
| 74 remoting.formatIq = new remoting.FormatIq(); | 78 remoting.formatIq = new remoting.FormatIq(); |
| 75 remoting.hostList = new remoting.HostList( | 79 remoting.hostList = new remoting.HostList( |
| 76 document.getElementById('host-list'), | 80 document.getElementById('host-list'), |
| 77 document.getElementById('host-list-empty'), | 81 document.getElementById('host-list-empty'), |
| 78 document.getElementById('host-list-error-message'), | 82 document.getElementById('host-list-error-message'), |
| 79 document.getElementById('host-list-refresh-failed-button'), | 83 document.getElementById('host-list-refresh-failed-button'), |
| 80 document.getElementById('host-list-loading-indicator')); | 84 document.getElementById('host-list-loading-indicator')); |
| 81 remoting.toolbar = new remoting.Toolbar( | |
| 82 document.getElementById('session-toolbar')); | |
| 83 remoting.clipboard = new remoting.Clipboard(); | 85 remoting.clipboard = new remoting.Clipboard(); |
| 84 var sandbox = /** @type {HTMLIFrameElement} */ | 86 var sandbox = /** @type {HTMLIFrameElement} */ |
| 85 document.getElementById('wcs-sandbox'); | 87 document.getElementById('wcs-sandbox'); |
| 86 remoting.wcsSandbox = new remoting.WcsSandboxContainer(sandbox.contentWindow); | 88 remoting.wcsSandbox = new remoting.WcsSandboxContainer(sandbox.contentWindow); |
| 87 var homeFeedback = new remoting.MenuButton( | 89 var homeFeedback = new remoting.MenuButton( |
| 88 document.getElementById('help-feedback-main')); | 90 document.getElementById('help-feedback-main')); |
| 89 var toolbarFeedback = new remoting.MenuButton( | 91 var toolbarFeedback = new remoting.MenuButton( |
| 90 document.getElementById('help-feedback-toolbar')); | 92 document.getElementById('help-feedback-toolbar')); |
| 91 remoting.manageHelpAndFeedback( | 93 remoting.manageHelpAndFeedback( |
| 92 document.getElementById('title-bar')); | 94 document.getElementById('title-bar')); |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 } | 589 } |
| 588 | 590 |
| 589 /** | 591 /** |
| 590 * Tests whether we are running on ChromeOS. | 592 * Tests whether we are running on ChromeOS. |
| 591 * | 593 * |
| 592 * @return {boolean} True if the platform is ChromeOS. | 594 * @return {boolean} True if the platform is ChromeOS. |
| 593 */ | 595 */ |
| 594 remoting.platformIsChromeOS = function() { | 596 remoting.platformIsChromeOS = function() { |
| 595 return navigator.userAgent.match(/\bCrOS\b/) != null; | 597 return navigator.userAgent.match(/\bCrOS\b/) != null; |
| 596 } | 598 } |
| OLD | NEW |