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

Unified Diff: remoting/host/setup/me2me_native_messaging_host.cc

Issue 1076093003: Added method to host daemon to exchange an auth code for just an OAuth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/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..ea9e3e64f7622b6e075b60b2241694216c22273b 100644
--- a/remoting/host/setup/me2me_native_messaging_host.cc
+++ b/remoting/host/setup/me2me_native_messaging_host.cc
@@ -160,7 +160,11 @@ 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") {
Lambros 2015/04/22 18:28:52 Please update me2me_native_messaging_host_unittest
John Williams 2015/04/22 20:11:25 It looks like to do this, I will have to make remo
Lambros 2015/04/22 21:22:59 OK, I thought it would be a simple addition to the
+ ProcessGetCredentialsFromAuthCode(
+ message_dict.Pass(), response.Pass(), false);
} else {
LOG(ERROR) << "Unsupported request type: " << type;
OnError();
@@ -422,7 +426,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 +444,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)));
}

Powered by Google App Engine
This is Rietveld 408576698