Chromium Code Reviews| Index: remoting/host/it2me/it2me_native_messaging_host.h |
| diff --git a/remoting/host/it2me/it2me_native_messaging_host.h b/remoting/host/it2me/it2me_native_messaging_host.h |
| index f9d8ac9753f97230cf674ddf86c340bf07972431..7dd09017a8d9e9c8e7a1060b7811603a2e9c7446 100644 |
| --- a/remoting/host/it2me/it2me_native_messaging_host.h |
| +++ b/remoting/host/it2me/it2me_native_messaging_host.h |
| @@ -8,32 +8,30 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| -#include "extensions/browser/api/messaging/native_messaging_channel.h" |
| +#include "extensions/browser/api/messaging/native_message_host.h" |
| #include "remoting/base/auto_thread_task_runner.h" |
| #include "remoting/host/it2me/it2me_host.h" |
| namespace base { |
| class DictionaryValue; |
| +class Value; |
| } // namespace base |
| namespace remoting { |
| // Implementation of the native messaging host process. |
| -class It2MeNativeMessagingHost |
| - : public It2MeHost::Observer, |
| - public extensions::NativeMessagingChannel::EventHandler { |
| +class It2MeNativeMessagingHost : public It2MeHost::Observer, |
| + public extensions::NativeMessageHost { |
| public: |
| - It2MeNativeMessagingHost( |
| - scoped_refptr<AutoThreadTaskRunner> task_runner, |
| - scoped_ptr<extensions::NativeMessagingChannel> channel, |
| - scoped_ptr<It2MeHostFactory> factory); |
| + It2MeNativeMessagingHost(scoped_refptr<AutoThreadTaskRunner> task_runner, |
| + scoped_ptr<It2MeHostFactory> factory); |
| virtual ~It2MeNativeMessagingHost(); |
| - void Start(const base::Closure& quit_closure); |
| - |
| - // extensions::NativeMessagingChannel::EventHandler implementation. |
| - virtual void OnMessage(scoped_ptr<base::Value> message) OVERRIDE; |
| - virtual void OnDisconnect() OVERRIDE; |
| + // extensions::NativeMessageHost implementation. |
| + virtual void OnMessage(const std::string& message) OVERRIDE; |
| + virtual void set_client(base::WeakPtr<Client> client) OVERRIDE; |
|
Sergey Ulanov
2014/09/30 20:33:39
This can be Client* instead of WeakPtr<> if you ta
kelvinp
2014/10/01 06:08:02
Done.
|
| + virtual scoped_refptr<base::SingleThreadTaskRunner> task_runner() |
| + const OVERRIDE; |
| // It2MeHost::Observer implementation. |
| virtual void OnClientAuthenticated(const std::string& client_username) |
| @@ -57,12 +55,9 @@ class It2MeNativeMessagingHost |
| scoped_ptr<base::DictionaryValue> response); |
| void SendErrorAndExit(scoped_ptr<base::DictionaryValue> response, |
| const std::string& description) const; |
| + void SendMessageToClient(scoped_ptr<base::DictionaryValue> message) const; |
| - base::Closure quit_closure_; |
| - |
| - scoped_refptr<AutoThreadTaskRunner> task_runner() const; |
| - |
| - scoped_ptr<extensions::NativeMessagingChannel> channel_; |
| + base::WeakPtr<Client> client_; |
| scoped_ptr<It2MeHostFactory> factory_; |
| scoped_ptr<ChromotingHostContext> host_context_; |
| scoped_refptr<It2MeHost> it2me_host_; |