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

Unified Diff: remoting/webapp/crd/js/host_list.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/host_installer.js ('k') | remoting/webapp/crd/js/host_list_api_impl.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_list.js
diff --git a/remoting/webapp/crd/js/host_list.js b/remoting/webapp/crd/js/host_list.js
index 81180152549a48df6607d5fec12f87b8c42ff9fa..778dd355d82fbe90a40687a20fa4fc977ce8a719 100644
--- a/remoting/webapp/crd/js/host_list.js
+++ b/remoting/webapp/crd/js/host_list.js
@@ -48,7 +48,7 @@ remoting.HostList = function(table, noHosts, errorMsg, errorButton,
/** @private {Array<remoting.Host>} */
this.hosts_ = [];
/** @private {!remoting.Error} */
- this.lastError_ = remoting.Error.NONE;
+ this.lastError_ = remoting.Error.none();
/** @private {remoting.LocalHostSection} */
this.localHostSection_ = new remoting.LocalHostSection(
/** @type {HTMLElement} */ (document.querySelector('.daemon-control')),
@@ -157,7 +157,7 @@ remoting.HostList.prototype.refresh = function(onDone) {
* @private
*/
remoting.HostList.prototype.onHostListResponse_ = function(onDone, hosts) {
- this.lastError_ = remoting.Error.NONE;
+ this.lastError_ = remoting.Error.none();
this.hosts_ = hosts;
this.sortHosts_();
this.save_();
@@ -213,7 +213,7 @@ remoting.HostList.prototype.display = function() {
if (this.lastError_.isError()) {
l10n.localizeElementFromTag(this.errorMsg_, this.lastError_.tag);
- if (this.lastError_.tag == remoting.Error.Tag.AUTHENTICATION_FAILED) {
+ if (this.lastError_.hasTag(remoting.Error.Tag.AUTHENTICATION_FAILED)) {
l10n.localizeElementFromTag(this.errorButton_,
/*i18n-content*/'SIGN_IN_BUTTON');
} else {
@@ -396,7 +396,7 @@ remoting.HostList.prototype.onLocalHostStarted = function(
* @private
*/
remoting.HostList.prototype.onErrorClick_ = function() {
- if (this.lastError_.tag == remoting.Error.Tag.AUTHENTICATION_FAILED) {
+ if (this.lastError_.hasTag(remoting.Error.Tag.AUTHENTICATION_FAILED)) {
remoting.handleAuthFailureAndRelaunch();
} else {
this.refresh(remoting.updateLocalHostState);
« no previous file with comments | « remoting/webapp/crd/js/host_installer.js ('k') | remoting/webapp/crd/js/host_list_api_impl.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698