diff options
Diffstat (limited to 'remoting/host/setup/native_messaging_host.h')
-rw-r--r-- | remoting/host/setup/native_messaging_host.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/remoting/host/setup/native_messaging_host.h b/remoting/host/setup/native_messaging_host.h index 309d63cad6..6a00080a84 100644 --- a/remoting/host/setup/native_messaging_host.h +++ b/remoting/host/setup/native_messaging_host.h @@ -13,6 +13,7 @@ #include "remoting/host/setup/daemon_controller.h" #include "remoting/host/setup/native_messaging_reader.h" #include "remoting/host/setup/native_messaging_writer.h" +#include "remoting/host/setup/oauth_client.h" namespace base { class DictionaryValue; @@ -21,6 +22,10 @@ class SingleThreadTaskRunner; class Value; } // namespace base +namespace gaia { +class GaiaOAuthClient; +} // namespace gaia + namespace remoting { namespace protocol { @@ -33,6 +38,7 @@ class NativeMessagingHost { NativeMessagingHost( scoped_ptr<DaemonController> daemon_controller, scoped_refptr<protocol::PairingRegistry> pairing_registry, + scoped_ptr<OAuthClient> oauth_client, base::PlatformFile input, base::PlatformFile output, scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, @@ -79,6 +85,11 @@ class NativeMessagingHost { scoped_ptr<base::DictionaryValue> response); bool ProcessGetDaemonState(const base::DictionaryValue& message, scoped_ptr<base::DictionaryValue> response); + bool ProcessGetHostClientId(const base::DictionaryValue& message, + scoped_ptr<base::DictionaryValue> response); + bool ProcessGetCredentialsFromAuthCode( + const base::DictionaryValue& message, + scoped_ptr<base::DictionaryValue> response); // Sends a response back to the client app. This can be called on either the // main message loop or the DaemonController's internal thread, so it @@ -101,6 +112,9 @@ class NativeMessagingHost { DaemonController::AsyncResult result); void SendBooleanResult(scoped_ptr<base::DictionaryValue> response, bool result); + void SendCredentialsResponse(scoped_ptr<base::DictionaryValue> response, + const std::string& user_email, + const std::string& refresh_token); // Callbacks may be invoked by e.g. DaemonController during destruction, // which use |weak_ptr_|, so it's important that it be the last member to be @@ -121,6 +135,9 @@ class NativeMessagingHost { // Used to load and update the paired clients for this host. scoped_refptr<protocol::PairingRegistry> pairing_registry_; + // Used to exchange the service account authorization code for credentials. + scoped_ptr<OAuthClient> oauth_client_; + base::WeakPtrFactory<NativeMessagingHost> weak_factory_; DISALLOW_COPY_AND_ASSIGN(NativeMessagingHost); |