Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: remoting/webapp/crd/js/crd_connect.js

Issue 955283002: Converted remoting.Error from an enum to a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | remoting/webapp/crd/js/desktop_remoting.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | remoting/webapp/crd/js/desktop_remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698