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

Unified Diff: remoting/webapp/base/js/application.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: 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/base/js/application.js
diff --git a/remoting/webapp/base/js/application.js b/remoting/webapp/base/js/application.js
index 82b64534c4a50a56a79271531acecc8fbb2c3b4e..06658c65affb0b580bb24b26cae0dd2ba8ec88e1 100644
--- a/remoting/webapp/base/js/application.js
+++ b/remoting/webapp/base/js/application.js
@@ -89,7 +89,7 @@ remoting.Application.prototype.start = function() {
if (error.hasTag(remoting.Error.Tag.CANCELLED)) {
that.exit();
} else {
- that.delegate_.signInFailed(error);
+ that.delegate_.handleAuthError(error);
}
}
)
@@ -169,6 +169,16 @@ remoting.Application.prototype.onError = function(errorTag) {
};
/**
+ * Called when an auth error needs to be displayed to the user.
+ *
+ * @param {!remoting.Error} errorTag The error to be localized and displayed.
+ * @return {void} Nothing.
+ */
+remoting.Application.prototype.onAuthError = function(errorTag) {
+ this.delegate_.handleAuthError(errorTag);
+};
+
+/**
* @return {remoting.SessionConnector} A session connector, creating a new one
* if necessary.
*/
@@ -255,14 +265,6 @@ remoting.Application.Delegate.prototype.init = function() {};
remoting.Application.Delegate.prototype.start = function(connector, token) {};
/**
- * Report an authentication error to the user. This is called in lieu of start()
- * if the user cannot be authenticated.
- *
- * @param {!remoting.Error} error The failure reason.
- */
-remoting.Application.Delegate.prototype.signInFailed = function(error) {};
-
-/**
* @return {string} Application product name to be used in UI.
*/
remoting.Application.Delegate.prototype.getApplicationName = function() {};
@@ -316,6 +318,14 @@ remoting.Application.Delegate.prototype.handleVideoStreamingStarted =
remoting.Application.Delegate.prototype.handleError = function(errorTag) {};
/**
+ * Report an authentication error to the user. This is called in lieu of start()
+ * if the user cannot be authenticated.
+ *
+ * @param {!remoting.Error} error The failure reason.
+ */
+remoting.Application.Delegate.prototype.handleAuthError = function(error) {};
+
+/**
* Perform any application-specific cleanup before exiting. This is called in
* lieu of start() if the user declines the app permissions, and will usually
* be called immediately prior to exiting, although delegates should not rely

Powered by Google App Engine
This is Rietveld 408576698