| 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 // TODO(jamiewalch): strict mode causes the page to crash so it's disabled for | 5 // TODO(jamiewalch): strict mode causes the page to crash so it's disabled for |
| 6 // now. Reinstate this when the associated bug is fixed. | 6 // now. Reinstate this when the associated bug is fixed. |
| 7 // http://code.google.com/p/v8/issues/detail?id=1423 | 7 // http://code.google.com/p/v8/issues/detail?id=1423 |
| 8 //"use strict"; | 8 //"use strict"; |
| 9 | 9 |
| 10 // TODO(ajwong): This seems like a bad idea to share the exact same object | 10 // TODO(ajwong): This seems like a bad idea to share the exact same object |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 221 |
| 222 showWaiting_(); | 222 showWaiting_(); |
| 223 | 223 |
| 224 var div = document.getElementById('plugin-wrapper'); | 224 var div = document.getElementById('plugin-wrapper'); |
| 225 var plugin = document.createElement('embed'); | 225 var plugin = document.createElement('embed'); |
| 226 plugin.setAttribute('type', remoting.PLUGIN_MIMETYPE); | 226 plugin.setAttribute('type', remoting.PLUGIN_MIMETYPE); |
| 227 plugin.setAttribute('hidden', 'true'); | 227 plugin.setAttribute('hidden', 'true'); |
| 228 plugin.setAttribute('id', remoting.HOST_PLUGIN_ID); | 228 plugin.setAttribute('id', remoting.HOST_PLUGIN_ID); |
| 229 div.appendChild(plugin); | 229 div.appendChild(plugin); |
| 230 plugin.onStateChanged = onStateChanged_; | 230 plugin.onStateChanged = onStateChanged_; |
| 231 plugin.logDebugInfoCallback = debugInfoCallback_; | 231 plugin.logDebugInfo = debugInfoCallback_; |
| 232 plugin.connect(remoting.getItem(remoting.EMAIL), | 232 plugin.connect(remoting.getItem(remoting.EMAIL), |
| 233 'oauth2:' + remoting.oauth2.getAccessToken()); | 233 'oauth2:' + remoting.oauth2.getAccessToken()); |
| 234 } | 234 } |
| 235 | 235 |
| 236 function onStateChanged_() { | 236 function onStateChanged_() { |
| 237 var plugin = document.getElementById(remoting.HOST_PLUGIN_ID); | 237 var plugin = document.getElementById(remoting.HOST_PLUGIN_ID); |
| 238 var state = plugin.state; | 238 var state = plugin.state; |
| 239 if (state == plugin.REQUESTED_ACCESS_CODE) { | 239 if (state == plugin.REQUESTED_ACCESS_CODE) { |
| 240 setHostMode('preparing-to-share'); | 240 setHostMode('preparing-to-share'); |
| 241 } else if (state == plugin.RECEIVED_ACCESS_CODE) { | 241 } else if (state == plugin.RECEIVED_ACCESS_CODE) { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 resolveSupportId(supportId); | 364 resolveSupportId(supportId); |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 function cancelPendingOperation() { | 368 function cancelPendingOperation() { |
| 369 document.getElementById('cancel-button').disabled = true; | 369 document.getElementById('cancel-button').disabled = true; |
| 370 if (remoting.currentMode == remoting.HOST_MODE) { | 370 if (remoting.currentMode == remoting.HOST_MODE) { |
| 371 cancelShare(); | 371 cancelShare(); |
| 372 } | 372 } |
| 373 } | 373 } |
| OLD | NEW |