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 if (remoting.Host.needsUpdate(host, webappVersion)) { | 45 if (remoting.Host.needsUpdate(host, webappVersion)) { |
45 var needsUpdateMessage = | 46 var needsUpdateMessage = |
46 document.getElementById('host-needs-update-message'); | 47 document.getElementById('host-needs-update-message'); |
47 l10n.localizeElementFromTag(needsUpdateMessage, | 48 l10n.localizeElementFromTag(needsUpdateMessage, |
48 /*i18n-content*/'HOST_NEEDS_UPDATE_TITLE', | 49 /*i18n-content*/'HOST_NEEDS_UPDATE_TITLE', |
49 host.hostName); | 50 host.hostName); |
50 /** @type {Element} */ | 51 /** @type {Element} */ |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (pairingInfo) { | 160 if (pairingInfo) { |
160 clientId = /** @type {string} */ (pairingInfo['clientId']); | 161 clientId = /** @type {string} */ (pairingInfo['clientId']); |
161 sharedSecret = /** @type {string} */ (pairingInfo['sharedSecret']); | 162 sharedSecret = /** @type {string} */ (pairingInfo['sharedSecret']); |
162 } | 163 } |
163 connector.connectMe2Me(host, requestPin, fetchThirdPartyToken, | 164 connector.connectMe2Me(host, requestPin, fetchThirdPartyToken, |
164 clientId, sharedSecret); | 165 clientId, sharedSecret); |
165 } | 166 } |
166 | 167 |
167 remoting.HostSettings.load(host.hostId, connectMe2MeHostSettingsRetrieved); | 168 remoting.HostSettings.load(host.hostId, connectMe2MeHostSettingsRetrieved); |
168 }; | 169 }; |
OLD | NEW |