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

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

Issue 1397463003: Report the Auth method for me2me connections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 2 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/me2me_telemetry_integration_test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/mock_client_plugin.js
diff --git a/remoting/webapp/crd/js/mock_client_plugin.js b/remoting/webapp/crd/js/mock_client_plugin.js
index 1163f1ed49769a60ea54792f92efdf34a4731ea3..cf0dfc3f18666d4f8ce9693eb0ea7a91e942538c 100644
--- a/remoting/webapp/crd/js/mock_client_plugin.js
+++ b/remoting/webapp/crd/js/mock_client_plugin.js
@@ -196,11 +196,11 @@ remoting.MockClientPlugin.prototype.mock$setConnectionStatus = function(
};
/**
- * @param {remoting.MockClientPlugin.AuthMethod} authMethod
+ * @param {remoting.ChromotingEvent.AuthMethod} authMethod
* @return {Promise}
*/
remoting.MockClientPlugin.prototype.mock$authenticate = function(authMethod) {
- var AuthMethod = remoting.MockClientPlugin.AuthMethod;
+ var AuthMethod = remoting.ChromotingEvent.AuthMethod;
var deferred = new base.Deferred();
var that = this;
@@ -218,7 +218,8 @@ remoting.MockClientPlugin.prototype.mock$authenticate = function(authMethod) {
deferred.resolve();
});
break;
- case AuthMethod.PAIRING:
+ case AuthMethod.PINLESS:
+ this.credentials_.getPairingInfo();
deferred.resolve();
}
return deferred.promise();
@@ -234,7 +235,7 @@ remoting.MockClientPlugin.prototype.mock$setPluginStatusChanged =
};
/**
- * @param {remoting.MockClientPlugin.AuthMethod} authMethod
+ * @param {remoting.ChromotingEvent.AuthMethod} authMethod
*/
remoting.MockClientPlugin.prototype.mock$useDefaultBehavior =
function(authMethod) {
@@ -252,12 +253,17 @@ remoting.MockClientPlugin.prototype.mock$useDefaultBehavior =
/**
* @param {remoting.ClientSession.ConnectionError} error
+ * @param {remoting.ChromotingEvent.AuthMethod=} opt_authMethod
*/
-remoting.MockClientPlugin.prototype.mock$returnErrorOnConnect = function(error){
+remoting.MockClientPlugin.prototype.mock$returnErrorOnConnect =
+ function(error, opt_authMethod){
var that = this;
var State = remoting.ClientSession.State;
this.mock$onConnect().then(function() {
that.mock$setConnectionStatus(State.CONNECTING);
+ var authMethod = opt_authMethod ? opt_authMethod :
+ remoting.ChromotingEvent.AuthMethod.PIN;
+ return that.mock$authenticate(authMethod);
}).then(function() {
that.mock$setConnectionStatus(State.FAILED, error);
});
@@ -294,7 +300,7 @@ remoting.MockClientPluginFactory.prototype.createPlugin =
this.onPluginCreated_(this.plugin_);
} else {
this.plugin_.mock$useDefaultBehavior(
- remoting.MockClientPlugin.AuthMethod.PIN);
+ remoting.ChromotingEvent.AuthMethod.PIN);
}
// Listens for plugin status changed.
@@ -388,11 +394,3 @@ remoting.MockConnection.prototype.restore = function() {
};
})();
-
-/** @enum {string} */
-remoting.MockClientPlugin.AuthMethod = {
- ACCESS_CODE: 'accessCode',
- PIN: 'pin',
- THIRD_PARTY: 'thirdParty',
- PAIRING: 'pairing'
-};
« no previous file with comments | « remoting/webapp/crd/js/me2me_telemetry_integration_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698