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

Unified Diff: remoting/webapp/crd/js/crd_connect.js

Issue 1004513002: Eliminated named constants for instances of remoting.Error. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | remoting/webapp/crd/js/crd_main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/crd_connect.js
diff --git a/remoting/webapp/crd/js/crd_connect.js b/remoting/webapp/crd/js/crd_connect.js
index 8fb2a1192251b4ae79f2913d34a90b9fd46b3d2b..6dfbb51850e3aae34ab1b822023f70dd46ef1784 100644
--- a/remoting/webapp/crd/js/crd_connect.js
+++ b/remoting/webapp/crd/js/crd_connect.js
@@ -20,9 +20,9 @@ remoting.connectIT2Me = function() {
var accessCode = document.getElementById('access-code-entry').value;
remoting.setMode(remoting.AppMode.CLIENT_CONNECTING);
remoting.It2MeConnectFlow.start(connector, accessCode).
- catch(function(/** remoting.Error */ reason){
+ catch(function(/** !remoting.Error */ reason){
var errorDiv = document.getElementById('connect-error-message');
- l10n.localizeElementFromTag(errorDiv, reason.tag);
+ l10n.localizeElementFromTag(errorDiv, reason.getTag());
remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME);
});
};
@@ -37,7 +37,8 @@ remoting.connectIT2Me = function() {
remoting.connectMe2Me = function(hostId) {
var host = remoting.hostList.getHostForId(hostId);
if (!host) {
- remoting.app.onError(remoting.Error.HOST_IS_OFFLINE);
+ remoting.app.onError(new remoting.Error(
+ remoting.Error.Tag.HOST_IS_OFFLINE));
return;
}
var webappVersion = chrome.runtime.getManifest().version;
@@ -47,7 +48,7 @@ remoting.connectMe2Me = function(hostId) {
needsUpdateDialog.showIfNecessary(webappVersion).then(function() {
remoting.connectMe2MeHostVersionAcknowledged_(host);
}).catch(function(/** remoting.Error */ error) {
- if (error.tag === remoting.Error.Tag.CANCELLED) {
+ if (error.hasTag(remoting.Error.Tag.CANCELLED)) {
remoting.setMode(remoting.AppMode.HOME);
}
});
« no previous file with comments | « remoting/webapp/crd/js/client_session.js ('k') | remoting/webapp/crd/js/crd_main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698