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

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

Issue 1020743002: [Chromoting] Move app-specific code out of remoting.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make isMe2MeInstallable private 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_event_handlers.js ('k') | remoting/webapp/crd/js/desktop_remoting.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/crd_main.js
diff --git a/remoting/webapp/crd/js/crd_main.js b/remoting/webapp/crd/js/crd_main.js
index 2f7b03f755590e84ba44219f9b7611c21922189c..20ae60aa9f2594cd55429eaa0e9ba78ae202d95f 100644
--- a/remoting/webapp/crd/js/crd_main.js
+++ b/remoting/webapp/crd/js/crd_main.js
@@ -17,7 +17,8 @@ remoting.initHostlist_ = function() {
document.getElementById('host-list-empty'),
document.getElementById('host-list-error-message'),
document.getElementById('host-list-refresh-failed-button'),
- document.getElementById('host-list-loading-indicator'));
+ document.getElementById('host-list-loading-indicator'),
+ remoting.showErrorMessage);
isHostModeSupported_().then(
/** @param {Boolean} supported */
@@ -180,6 +181,23 @@ remoting.startDesktopRemotingForTesting = function() {
}
}
+/**
+ * @param {!remoting.Error} error The failure reason.
+ */
+remoting.showErrorMessage = function(error) {
+ l10n.localizeElementFromTag(
+ document.getElementById('token-refresh-error-message'),
+ error.getTag());
+ var auth_failed = (error.hasTag(remoting.Error.Tag.AUTHENTICATION_FAILED));
+ if (auth_failed && base.isAppsV2()) {
+ remoting.handleAuthFailureAndRelaunch();
+ } else {
+ document.getElementById('token-refresh-auth-failed').hidden = !auth_failed;
+ document.getElementById('token-refresh-other-error').hidden = auth_failed;
+ remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED);
+ }
+};
+
remoting.startDesktopRemoting = function() {
remoting.app = new remoting.Application(remoting.app_capabilities());
« no previous file with comments | « remoting/webapp/crd/js/crd_event_handlers.js ('k') | remoting/webapp/crd/js/desktop_remoting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698