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

Unified Diff: remoting/webapp/crd/js/desktop_remoting.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/crd_main.js ('k') | remoting/webapp/crd/js/dns_blackhole_checker.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/desktop_remoting.js
diff --git a/remoting/webapp/crd/js/desktop_remoting.js b/remoting/webapp/crd/js/desktop_remoting.js
index 10e35c5437115d8287fb776eef0c7bbde13a54ce..e94b84200fafe8314b74fb8dd2b8e83b339b4431 100644
--- a/remoting/webapp/crd/js/desktop_remoting.js
+++ b/remoting/webapp/crd/js/desktop_remoting.js
@@ -277,7 +277,7 @@ remoting.DesktopRemoting.prototype.handleConnectionFailed = function(
that.handleError(error);
};
- if (error.tag == remoting.Error.Tag.HOST_IS_OFFLINE &&
+ if (error.hasTag(remoting.Error.Tag.HOST_IS_OFFLINE) &&
that.refreshHostJidIfOffline_) {
that.refreshHostJidIfOffline_ = false;
// The plugin will be re-created when the host finished refreshing
@@ -313,10 +313,10 @@ remoting.DesktopRemoting.prototype.handleExtensionMessage = function(
* @return {void} Nothing.
*/
remoting.DesktopRemoting.prototype.handleError = function(error) {
- console.error('Connection failed:' + error.tag);
+ console.error('Connection failed: ' + error.toString());
remoting.accessCode = '';
- if (error.tag === remoting.Error.Tag.AUTHENTICATION_FAILED) {
+ if (error.hasTag(remoting.Error.Tag.AUTHENTICATION_FAILED)) {
remoting.setMode(remoting.AppMode.HOME);
remoting.handleAuthFailureAndRelaunch();
return;
@@ -326,7 +326,7 @@ remoting.DesktopRemoting.prototype.handleError = function(error) {
this.refreshHostJidIfOffline_ = true;
var errorDiv = document.getElementById('connect-error-message');
- l10n.localizeElementFromTag(errorDiv, error.tag);
+ l10n.localizeElementFromTag(errorDiv, error.getTag());
var mode = remoting.clientSession ? remoting.desktopConnectedView.getMode()
: this.app_.getSessionConnector().getConnectionMode();
« no previous file with comments | « remoting/webapp/crd/js/crd_main.js ('k') | remoting/webapp/crd/js/dns_blackhole_checker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698