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 var remoting = chrome.extension.getBackgroundPage().remoting; | 8 var remoting = chrome.extension.getBackgroundPage().remoting; |
9 | 9 |
10 // Message id so that we can identify (and ignore) message fade operations for | 10 // Message id so that we can identify (and ignore) message fade operations for |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 plugin.loginChallenge = loginChallengeCallback; | 117 plugin.loginChallenge = loginChallengeCallback; |
118 | 118 |
119 addToDebugLog('Connect as user ' + remoting.username); | 119 addToDebugLog('Connect as user ' + remoting.username); |
120 | 120 |
121 // TODO(garykac): Clean exit if |connect| isn't a function. | 121 // TODO(garykac): Clean exit if |connect| isn't a function. |
122 if (typeof plugin.connect === 'function') { | 122 if (typeof plugin.connect === 'function') { |
123 if (remoting.connectMethod == 'sandboxed') { | 123 if (remoting.connectMethod == 'sandboxed') { |
124 registerConnection(); | 124 registerConnection(); |
125 } else { | 125 } else { |
126 plugin.connectUnsandboxed(remoting.hostjid, remoting.username, | 126 plugin.connectUnsandboxed(remoting.hostjid, remoting.username, |
127 remoting.xmppAuthToken, remoting.accessCode); | 127 'oauth2:' + remoting.oauth2.getAccessToken(), |
| 128 remoting.accessCode); |
128 } | 129 } |
129 } else { | 130 } else { |
130 addToDebugLog('ERROR: remoting plugin not loaded'); | 131 addToDebugLog('ERROR: remoting plugin not loaded'); |
131 setClientStateMessage('Plugin not loaded'); | 132 setClientStateMessage('Plugin not loaded'); |
132 } | 133 } |
133 | 134 |
134 } | 135 } |
135 | 136 |
136 function toggleDebugLog() { | 137 function toggleDebugLog() { |
137 debugLog = document.getElementById('debug_log'); | 138 debugLog = document.getElementById('debug_log'); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 setClientStateMessage( | 311 setClientStateMessage( |
311 'Video stats: bandwidth: ' + videoBandwidth.toFixed(2) + 'Kbps' + | 312 'Video stats: bandwidth: ' + videoBandwidth.toFixed(2) + 'Kbps' + |
312 ', Latency: capture: ' + videoCaptureLatency.toFixed(2) + 'ms' + | 313 ', Latency: capture: ' + videoCaptureLatency.toFixed(2) + 'ms' + |
313 ', encode: ' + videoEncodeLatency.toFixed(2) + 'ms' + | 314 ', encode: ' + videoEncodeLatency.toFixed(2) + 'ms' + |
314 ', decode: ' + videoDecodeLatency.toFixed(2) + 'ms' + | 315 ', decode: ' + videoDecodeLatency.toFixed(2) + 'ms' + |
315 ', render: ' + videoRenderLatency.toFixed(2) + 'ms'); | 316 ', render: ' + videoRenderLatency.toFixed(2) + 'ms'); |
316 | 317 |
317 // Update the stats once per second. | 318 // Update the stats once per second. |
318 window.setTimeout('updateStatusBarStats()', 1000); | 319 window.setTimeout('updateStatusBarStats()', 1000); |
319 } | 320 } |
OLD | NEW |