OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * Functions related to the 'client screen' for Chromoting. | 7 * Functions related to the 'client screen' for Chromoting. |
8 */ | 8 */ |
9 | 9 |
10 'use strict'; | 10 'use strict'; |
(...skipping 19 matching lines...) Expand all Loading... |
30 /** | 30 /** |
31 * Entry-point for Me2Me connections, handling showing of the host-upgrade nag | 31 * Entry-point for Me2Me connections, handling showing of the host-upgrade nag |
32 * dialog if necessary. | 32 * dialog if necessary. |
33 * | 33 * |
34 * @param {string} hostId The unique id of the host. | 34 * @param {string} hostId The unique id of the host. |
35 * @return {void} Nothing. | 35 * @return {void} Nothing. |
36 */ | 36 */ |
37 remoting.connectMe2Me = function(hostId) { | 37 remoting.connectMe2Me = function(hostId) { |
38 var host = remoting.hostList.getHostForId(hostId); | 38 var host = remoting.hostList.getHostForId(hostId); |
39 if (!host) { | 39 if (!host) { |
40 remoting.app.onError(remoting.Error.HOST_IS_OFFLINE); | 40 remoting.app.onError(new remoting.Error( |
| 41 remoting.Error.Tag.HOST_IS_OFFLINE)); |
41 return; | 42 return; |
42 } | 43 } |
43 var webappVersion = chrome.runtime.getManifest().version; | 44 var webappVersion = chrome.runtime.getManifest().version; |
44 var needsUpdateDialog = new remoting.HostNeedsUpdateDialog( | 45 var needsUpdateDialog = new remoting.HostNeedsUpdateDialog( |
45 document.getElementById('host-needs-update-dialog'), host); | 46 document.getElementById('host-needs-update-dialog'), host); |
46 | 47 |
47 needsUpdateDialog.showIfNecessary(webappVersion).then(function() { | 48 needsUpdateDialog.showIfNecessary(webappVersion).then(function() { |
48 remoting.connectMe2MeHostVersionAcknowledged_(host); | 49 remoting.connectMe2MeHostVersionAcknowledged_(host); |
49 }).catch(function(/** remoting.Error */ error) { | 50 }).catch(function(/** remoting.Error */ error) { |
50 if (error.tag === remoting.Error.Tag.CANCELLED) { | 51 if (error.tag === remoting.Error.Tag.CANCELLED) { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 if (pairingInfo) { | 144 if (pairingInfo) { |
144 clientId = /** @type {string} */ (pairingInfo['clientId']); | 145 clientId = /** @type {string} */ (pairingInfo['clientId']); |
145 sharedSecret = /** @type {string} */ (pairingInfo['sharedSecret']); | 146 sharedSecret = /** @type {string} */ (pairingInfo['sharedSecret']); |
146 } | 147 } |
147 connector.connectMe2Me(host, requestPin, fetchThirdPartyToken, | 148 connector.connectMe2Me(host, requestPin, fetchThirdPartyToken, |
148 clientId, sharedSecret); | 149 clientId, sharedSecret); |
149 } | 150 } |
150 | 151 |
151 remoting.HostSettings.load(host.hostId, connectMe2MeHostSettingsRetrieved); | 152 remoting.HostSettings.load(host.hostId, connectMe2MeHostSettingsRetrieved); |
152 }; | 153 }; |
OLD | NEW |