OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Maximum numer of lines to record in the debug log. | 5 // Maximum numer of lines to record in the debug log. |
6 // Only the most recent <n> lines are displayed. | 6 // Only the most recent <n> lines are displayed. |
7 var MAX_DEBUG_LOG_SIZE = 1000; | 7 var MAX_DEBUG_LOG_SIZE = 1000; |
8 | 8 |
9 var remoting = chrome.extension.getBackgroundPage().remoting; | 9 var remoting = chrome.extension.getBackgroundPage().remoting; |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 139 } |
140 | 140 |
141 addToDebugLog('Connect as user ' + remoting.username); | 141 addToDebugLog('Connect as user ' + remoting.username); |
142 | 142 |
143 // TODO(garykac): Clean exit if |connect| isn't a function. | 143 // TODO(garykac): Clean exit if |connect| isn't a function. |
144 if (typeof plugin.connect === 'function') { | 144 if (typeof plugin.connect === 'function') { |
145 if (remoting.connectMethod == 'sandboxed') { | 145 if (remoting.connectMethod == 'sandboxed') { |
146 registerConnection(); | 146 registerConnection(); |
147 } else { | 147 } else { |
148 plugin.connectUnsandboxed(remoting.hostjid, remoting.username, | 148 plugin.connectUnsandboxed(remoting.hostjid, remoting.username, |
149 remoting.xmppAuthToken, remoting.accessCode); | 149 'oauth2:' + remoting.oauth2.getAccessToken(), |
| 150 remoting.accessCode); |
150 } | 151 } |
151 } else { | 152 } else { |
152 addToDebugLog('ERROR: remoting plugin not loaded'); | 153 addToDebugLog('ERROR: remoting plugin not loaded'); |
153 setClientStateMessage('Plugin not loaded'); | 154 setClientStateMessage('Plugin not loaded'); |
154 } | 155 } |
155 | 156 |
156 } | 157 } |
157 | 158 |
158 function toggleDebugLog() { | 159 function toggleDebugLog() { |
159 debugLog = document.getElementById('debug_log'); | 160 debugLog = document.getElementById('debug_log'); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 setClientStateMessage( | 347 setClientStateMessage( |
347 'Video stats: bandwidth: ' + videoBandwidth.toFixed(2) + units + | 348 'Video stats: bandwidth: ' + videoBandwidth.toFixed(2) + units + |
348 ', Latency: capture: ' + videoCaptureLatency.toFixed(2) + 'ms' + | 349 ', Latency: capture: ' + videoCaptureLatency.toFixed(2) + 'ms' + |
349 ', encode: ' + videoEncodeLatency.toFixed(2) + 'ms' + | 350 ', encode: ' + videoEncodeLatency.toFixed(2) + 'ms' + |
350 ', decode: ' + videoDecodeLatency.toFixed(2) + 'ms' + | 351 ', decode: ' + videoDecodeLatency.toFixed(2) + 'ms' + |
351 ', render: ' + videoRenderLatency.toFixed(2) + 'ms'); | 352 ', render: ' + videoRenderLatency.toFixed(2) + 'ms'); |
352 | 353 |
353 // Update the stats once per second. | 354 // Update the stats once per second. |
354 window.setTimeout('updateStatusBarStats()', 1000); | 355 window.setTimeout('updateStatusBarStats()', 1000); |
355 } | 356 } |
OLD | NEW |