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

Unified Diff: remoting/webapp/crd/js/host_screen.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: Requested changes. Created 5 years, 10 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/host_screen.js
diff --git a/remoting/webapp/crd/js/host_screen.js b/remoting/webapp/crd/js/host_screen.js
index 183deb7f1884543312d7222909f8c9531ab3cd36..ebf24dfb13257919cac0309e96da3235f503db47 100644
--- a/remoting/webapp/crd/js/host_screen.js
+++ b/remoting/webapp/crd/js/host_screen.js
@@ -57,9 +57,9 @@ remoting.tryShare = function() {
}
};
- /** @param {remoting.Error} error */
+ /** @param {!remoting.Error} error */
var onInstallError = function(error) {
- if (error == remoting.Error.CANCELLED) {
+ if (error.tag == remoting.Error.Tag.CANCELLED) {
remoting.setMode(remoting.AppMode.HOME);
} else {
showShareError_(error);
@@ -188,13 +188,13 @@ function logDebugInfo_(msg) {
/**
* Show a host-side error message.
*
- * @param {string} errorTag The error message to be localized and displayed.
+ * @param {!remoting.Error} error The error to be localized and displayed.
* @return {void} Nothing.
*/
-function showShareError_(errorTag) {
+function showShareError_(error) {
var errorDiv = document.getElementById('host-plugin-error');
- l10n.localizeElementFromTag(errorDiv, errorTag);
- console.error('Sharing error: ' + errorTag);
+ l10n.localizeElementFromTag(errorDiv, error.tag);
+ console.error('Sharing error: %o', error);
Jamie 2015/03/02 18:28:10 Don't use %o here, either.
John Williams 2015/03/02 22:01:37 Done.
remoting.setMode(remoting.AppMode.HOST_SHARE_FAILED);
cleanUp();
}
@@ -336,4 +336,4 @@ function onNatTraversalPolicyChanged_(enabled) {
}
}
-})();
+})();

Powered by Google App Engine
This is Rietveld 408576698