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

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

Issue 1054273002: [Webapp Refactor] Implements remoting.Activity. (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/it2me_connect_flow.js
diff --git a/remoting/webapp/crd/js/it2me_connect_flow.js b/remoting/webapp/crd/js/it2me_connect_flow.js
index 7ac902c5b9159aacce5bfc324c8865bb73c8906b..cd500079b31c655df28da159e05ffe8856cded41 100644
--- a/remoting/webapp/crd/js/it2me_connect_flow.js
+++ b/remoting/webapp/crd/js/it2me_connect_flow.js
@@ -17,6 +17,7 @@ var ACCESS_CODE_LENGTH = SUPPORT_ID_LENGTH + HOST_SECRET_LENGTH;
/**
* @param {remoting.SessionConnector} sessionConnector
* @constructor
+ * @implements {remoting.ConnectFlow}
*/
remoting.It2MeConnectFlow = function(sessionConnector) {
/** @private */
@@ -35,6 +36,7 @@ remoting.It2MeConnectFlow = function(sessionConnector) {
form.querySelector('#cancel-access-code-button'));
};
+remoting.It2MeConnectFlow.prototype.dispose = function() {};
remoting.It2MeConnectFlow.prototype.start = function() {
var that = this;
@@ -65,6 +67,34 @@ remoting.It2MeConnectFlow.prototype.start = function() {
};
/**
+ * @param {!remoting.Error} error
+ */
+remoting.It2MeConnectFlow.prototype.onConnectionFailed = function(error) {
+ this.onError(error);
+};
+
+/**
+ * @param {!remoting.ConnectionInfo} connectionInfo
+ */
+remoting.It2MeConnectFlow.prototype.onConnected = function(connectionInfo) {
+ this.accessCodeDialog_.inputField().value = '';
+};
+
+remoting.It2MeConnectFlow.prototype.onDisconnected = function() {
+ remoting.setMode(remoting.AppMode.CLIENT_SESSION_FINISHED_IT2ME);
+};
+
+/**
+ * @param {!remoting.Error} error
+ */
+remoting.It2MeConnectFlow.prototype.onError = function(error) {
+ var errorDiv = document.getElementById('connect-error-message');
+ l10n.localizeElementFromTag(errorDiv, error.getTag());
+ remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME);
+};
+
+
+/**
* @param {string} accessCode
* @return {Promise} Promise that resolves if the access code is valid.
* @private

Powered by Google App Engine
This is Rietveld 408576698