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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 } | 134 } |
135 | 135 |
136 var onLoad = function() { | 136 var onLoad = function() { |
137 // Parse URL parameters. | 137 // Parse URL parameters. |
138 var urlParams = getUrlParameters_(); | 138 var urlParams = getUrlParameters_(); |
139 if ('mode' in urlParams) { | 139 if ('mode' in urlParams) { |
140 if (urlParams['mode'] == 'me2me') { | 140 if (urlParams['mode'] == 'me2me') { |
141 var hostId = urlParams['hostId']; | 141 var hostId = urlParams['hostId']; |
142 remoting.connectMe2Me(hostId); | 142 remoting.connectMe2Me(hostId); |
143 return; | 143 return; |
| 144 } else if (urlParams['mode'] == 'hangout') { |
| 145 var accessCode = urlParams['accessCode']; |
| 146 remoting.ensureSessionConnector_(); |
| 147 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
| 148 remoting.connector.connectIT2Me(accessCode); |
| 149 |
| 150 document.body.classList.add('hangout-remote-assistance'); |
| 151 var hangoutSession = new remoting.HangoutSession(); |
| 152 hangoutSession.init(); |
| 153 return; |
144 } | 154 } |
145 } | 155 } |
146 // No valid URL parameters, start up normally. | 156 // No valid URL parameters, start up normally. |
147 remoting.initHomeScreenUi(); | 157 remoting.initHomeScreenUi(); |
148 } | 158 } |
149 remoting.hostList.load(onLoad); | 159 remoting.hostList.load(onLoad); |
150 | 160 |
151 // For Apps v1, check the tab type to warn the user if they are not getting | 161 // For Apps v1, check the tab type to warn the user if they are not getting |
152 // the best keyboard experience. | 162 // the best keyboard experience. |
153 if (!remoting.isAppsV2 && !remoting.platformIsMac()) { | 163 if (!remoting.isAppsV2 && !remoting.platformIsMac()) { |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 } | 565 } |
556 | 566 |
557 /** | 567 /** |
558 * Tests whether we are running on ChromeOS. | 568 * Tests whether we are running on ChromeOS. |
559 * | 569 * |
560 * @return {boolean} True if the platform is ChromeOS. | 570 * @return {boolean} True if the platform is ChromeOS. |
561 */ | 571 */ |
562 remoting.platformIsChromeOS = function() { | 572 remoting.platformIsChromeOS = function() { |
563 return navigator.userAgent.match(/\bCrOS\b/) != null; | 573 return navigator.userAgent.match(/\bCrOS\b/) != null; |
564 } | 574 } |
OLD | NEW |