| 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Class handling creation and teardown of a remoting host session. | 7 * Class handling creation and teardown of a remoting host session. |
| 8 * | 8 * |
| 9 * This abstracts a <embed> element and controls the plugin which does the | 9 * This abstracts a <embed> element and controls the plugin which does the |
| 10 * actual remoting work. There should be no UI code inside this class. It | 10 * actual remoting work. There should be no UI code inside this class. It |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // must be kept in sync. | 29 // must be kept in sync. |
| 30 /** @enum {number} */ | 30 /** @enum {number} */ |
| 31 remoting.HostSession.State = { | 31 remoting.HostSession.State = { |
| 32 UNKNOWN: -1, | 32 UNKNOWN: -1, |
| 33 DISCONNECTED: 0, | 33 DISCONNECTED: 0, |
| 34 STARTING: 1, | 34 STARTING: 1, |
| 35 REQUESTED_ACCESS_CODE: 2, | 35 REQUESTED_ACCESS_CODE: 2, |
| 36 RECEIVED_ACCESS_CODE: 3, | 36 RECEIVED_ACCESS_CODE: 3, |
| 37 CONNECTED: 4, | 37 CONNECTED: 4, |
| 38 DISCONNECTING: 5, | 38 DISCONNECTING: 5, |
| 39 ERROR: 6 | 39 ERROR: 6, |
| 40 INVALID_DOMAIN_ERROR: 7 |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 /** | 43 /** |
| 43 * Create an instance of the host plugin. | 44 * Create an instance of the host plugin. |
| 44 * @return {remoting.HostPlugin} The new plugin instance. | 45 * @return {remoting.HostPlugin} The new plugin instance. |
| 45 */ | 46 */ |
| 46 remoting.HostSession.createPlugin = function() { | 47 remoting.HostSession.createPlugin = function() { |
| 47 var plugin = document.createElement('embed'); | 48 var plugin = document.createElement('embed'); |
| 48 plugin.type = remoting.PLUGIN_MIMETYPE; | 49 plugin.type = remoting.PLUGIN_MIMETYPE; |
| 49 // Hiding the plugin means it doesn't load, so make it size zero instead. | 50 // Hiding the plugin means it doesn't load, so make it size zero instead. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 }; | 113 }; |
| 113 | 114 |
| 114 | 115 |
| 115 /** | 116 /** |
| 116 * Remove the plugin element from the document. | 117 * Remove the plugin element from the document. |
| 117 * @return {void} Nothing. | 118 * @return {void} Nothing. |
| 118 */ | 119 */ |
| 119 remoting.HostSession.prototype.removePlugin = function() { | 120 remoting.HostSession.prototype.removePlugin = function() { |
| 120 this.plugin.parentNode.removeChild(this.plugin); | 121 this.plugin.parentNode.removeChild(this.plugin); |
| 121 }; | 122 }; |
| OLD | NEW |