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

Unified Diff: remoting/host/it2me/it2me_native_messaging_host.h

Issue 558403002: Remote Assistance on Chrome OS Part II - Native Messaging renaming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/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 1445872616aabd10738b3d8fff564795ef62b065..8b0489485d087b2da6054e0fcfb36b124d3dbc38 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.h
+++ b/remoting/host/it2me/it2me_native_messaging_host.h
@@ -8,9 +8,9 @@
#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 "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/it2me/it2me_host.h"
-#include "remoting/host/native_messaging/native_messaging_channel.h"
namespace base {
class DictionaryValue;
@@ -19,15 +19,21 @@ class DictionaryValue;
namespace remoting {
// Implementation of the native messaging host process.
-class It2MeNativeMessagingHost : public It2MeHost::Observer {
+class It2MeNativeMessagingHost
Sergey Ulanov 2014/09/17 02:32:22 I'm not sure I understand how this will work in ch
kelvinp 2014/09/17 23:06:16 Neither, the Channel only representing the sending
+ : public It2MeHost::Observer,
+ public extensions::NativeMessagingChannel::EventHandler {
public:
It2MeNativeMessagingHost(
scoped_refptr<AutoThreadTaskRunner> task_runner,
- scoped_ptr<NativeMessagingChannel> channel,
+ scoped_ptr<extensions::NativeMessagingChannel> channel,
scoped_ptr<It2MeHostFactory> factory);
virtual ~It2MeNativeMessagingHost();
- void Start(const base::Closure& quit_closure) const;
+ void Start(const base::Closure& quit_closure);
+
+ // extensions::NativeMessagingChannel::EventHandler implementation
+ virtual void OnMessage(scoped_ptr<base::Value> message) OVERRIDE;
+ virtual void OnDisconnect() OVERRIDE;
// It2MeHost::Observer implementation
virtual void OnClientAuthenticated(const std::string& client_username)
@@ -40,8 +46,6 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer {
static std::string HostStateToString(It2MeHostState host_state);
private:
- void ProcessMessage(scoped_ptr<base::DictionaryValue> message);
-
// These "Process.." methods handle specific request types. The |response|
// dictionary is pre-filled by ProcessMessage() with the parts of the
// response already known ("id" and "type" fields).
@@ -54,9 +58,11 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer {
void SendErrorAndExit(scoped_ptr<base::DictionaryValue> response,
const std::string& description) const;
+ base::Closure quit_closure_;
+
scoped_refptr<AutoThreadTaskRunner> task_runner() const;
- scoped_ptr<NativeMessagingChannel> channel_;
+ scoped_ptr<extensions::NativeMessagingChannel> channel_;
scoped_ptr<It2MeHostFactory> factory_;
scoped_ptr<ChromotingHostContext> host_context_;
scoped_refptr<It2MeHost> it2me_host_;

Powered by Google App Engine
This is Rietveld 408576698