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

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
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 c345d6444320779d5b2f807a34b0d22e1e06c9e6..f8bcb551e8f833216739b215a234317c1ec0c64e 100644
--- a/remoting/webapp/crd/js/desktop_remoting.js
+++ b/remoting/webapp/crd/js/desktop_remoting.js
@@ -266,7 +266,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
@@ -302,10 +302,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);
Jamie 2015/03/13 17:56:17 This (and below) looks like another change in the
John Williams 2015/03/13 19:30:29 This one was deliberate, since I was trying to min
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;
@@ -315,7 +315,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);
var mode = remoting.clientSession ? remoting.desktopConnectedView.getMode()
: this.app_.getSessionConnector().getConnectionMode();

Powered by Google App Engine
This is Rietveld 408576698