Commit 35a5c82f authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

[Remoting Mobile] Rename ChromotingSession::ProvideSecret

This method doesn't use the PIN. This CL renames this method to
RequestPairing.

Bug: 817566
Change-Id: I50cc8da936ae7242c2f227e8b4f78f013f26f6b1
Reviewed-on: https://chromium-review.googlesource.com/974461Reviewed-by: default avatarJoe Downing <joedow@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544917}
parent 7744aabb
......@@ -592,18 +592,8 @@ void ChromotingSession::HandleOnThirdPartyTokenFetched(
token, shared_secret);
}
void ChromotingSession::ProvideSecret(const std::string& pin,
bool create_pairing,
const std::string& device_name) {
// TODO(nicholss): |pin| here is not used. Maybe there was an api refactor and
// this was not cleaned up. The auth pin providing mechanism seems to be call
// ProvideSecret, and then call the auth callback. When session moves to
// Connected state, this chromoing session calls RequestPairing based on
// create_pairing.
if (create_pairing) {
RunCoreTaskOnNetworkThread(FROM_HERE, &Core::RequestPairing, device_name);
}
void ChromotingSession::RequestPairing(const std::string& device_name) {
RunCoreTaskOnNetworkThread(FROM_HERE, &Core::RequestPairing, device_name);
}
void ChromotingSession::SendMouseEvent(int x,
......
......@@ -110,14 +110,8 @@ class ChromotingSession : public ClientInputInjector {
void HandleOnThirdPartyTokenFetched(const std::string& token,
const std::string& shared_secret);
// Provides the user's PIN and resumes the host authentication attempt. Call
// on the UI thread once the user has finished entering this PIN into the UI,
// but only after the UI has been asked to provide a PIN (via FetchSecret()).
// TODO(yuweih): Rename this to RequestPairing(). PIN is provided by a
// completely different codepath.
void ProvideSecret(const std::string& pin,
bool create_pair,
const std::string& device_name);
// Requests pairing between the host and client for PIN-less authentication.
void RequestPairing(const std::string& device_name);
// Moves the host's cursor to the specified coordinates, optionally with some
// mouse button depressed. If |button| is BUTTON_UNDEFINED, no click is made.
......
......@@ -187,9 +187,8 @@ void JniClient::AuthenticationResponse(
const JavaParamRef<jstring>& pin,
jboolean createPair,
const JavaParamRef<jstring>& deviceName) {
if (session_) {
session_->ProvideSecret(ConvertJavaStringToUTF8(env, pin), createPair,
ConvertJavaStringToUTF8(env, deviceName));
if (session_ && createPair) {
session_->RequestPairing(ConvertJavaStringToUTF8(env, deviceName));
}
if (secret_fetcher_) {
......
......@@ -210,15 +210,11 @@ static void ResolveFeedbackDataCallback(
- (void)hostSessionPinProvided:(NSNotification*)notification {
NSString* pin = [[notification userInfo] objectForKey:kHostSessionPin];
NSString* name = UIDevice.currentDevice.name;
BOOL createPairing = [[[notification userInfo]
BOOL shouldCreatePairing = [[[notification userInfo]
objectForKey:kHostSessionCreatePairing] boolValue];
// TODO(nicholss): Look into refactoring ProvideSecret. It is mis-named and
// does not use pin.
if (_session) {
_session->ProvideSecret(base::SysNSStringToUTF8(pin),
(createPairing == YES),
base::SysNSStringToUTF8(name));
if (_session && shouldCreatePairing) {
_session->RequestPairing(base::SysNSStringToUTF8(name));
}
if (_secretFetchedCallback) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment