Index: remoting/host/setup/me2me_native_messaging_host.cc |
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/me2me_native_messaging_host.cc |
index 12e688b13856cb29876693648cf88aa6965aa5c4..e0c23a66c944c6b2fbd07a3d14bdb8de4141148d 100644 |
--- a/remoting/host/setup/me2me_native_messaging_host.cc |
+++ b/remoting/host/setup/me2me_native_messaging_host.cc |
@@ -160,7 +160,13 @@ void Me2MeNativeMessagingHost::OnMessage(scoped_ptr<base::Value> message) { |
} else if (type == "getHostClientId") { |
ProcessGetHostClientId(message_dict.Pass(), response.Pass()); |
} else if (type == "getCredentialsFromAuthCode") { |
- ProcessGetCredentialsFromAuthCode(message_dict.Pass(), response.Pass()); |
+ ProcessGetCredentialsFromAuthCode( |
+ message_dict.Pass(), response.Pass(), true); |
+ } else if (type == "getTokenFromAuthCode") { |
+ // TODO(jrw): Add a capability for this method so the webapp can |
+ // check that it's supported before registering a host with GCD. |
+ ProcessGetCredentialsFromAuthCode( |
+ message_dict.Pass(), response.Pass(), false); |
} else { |
LOG(ERROR) << "Unsupported request type: " << type; |
OnError(); |
@@ -422,7 +428,8 @@ void Me2MeNativeMessagingHost::ProcessGetHostClientId( |
void Me2MeNativeMessagingHost::ProcessGetCredentialsFromAuthCode( |
scoped_ptr<base::DictionaryValue> message, |
- scoped_ptr<base::DictionaryValue> response) { |
+ scoped_ptr<base::DictionaryValue> response, |
+ bool need_user_email) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
std::string auth_code; |
@@ -439,7 +446,7 @@ void Me2MeNativeMessagingHost::ProcessGetCredentialsFromAuthCode( |
}; |
oauth_client_->GetCredentialsFromAuthCode( |
- oauth_client_info, auth_code, base::Bind( |
+ oauth_client_info, auth_code, need_user_email, base::Bind( |
&Me2MeNativeMessagingHost::SendCredentialsResponse, weak_ptr_, |
base::Passed(&response))); |
} |