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

Unified Diff: remoting/host/setup/me2me_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/setup/me2me_native_messaging_host.h
diff --git a/remoting/host/setup/me2me_native_messaging_host.h b/remoting/host/setup/me2me_native_messaging_host.h
index e4a6748aba8c0354d088115b079a2331b10ff368..cff0c8a48e1f4171b25289eaea541593237daad4 100644
--- a/remoting/host/setup/me2me_native_messaging_host.h
+++ b/remoting/host/setup/me2me_native_messaging_host.h
@@ -10,7 +10,8 @@
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "base/timer/timer.h"
-#include "remoting/host/native_messaging/native_messaging_channel.h"
+#include "extensions/browser/api/messaging/native_messaging_channel.h"
+
#include "remoting/host/setup/daemon_controller.h"
#include "remoting/host/setup/oauth_client.h"
@@ -34,14 +35,13 @@ class PairingRegistry;
} // namespace protocol
// Implementation of the me2me native messaging host.
-class Me2MeNativeMessagingHost {
+class Me2MeNativeMessagingHost
+ : public extensions::NativeMessagingChannel::EventHandler {
public:
- typedef NativeMessagingChannel::SendMessageCallback SendMessageCallback;
-
Me2MeNativeMessagingHost(
bool needs_elevation,
intptr_t parent_window_handle,
- scoped_ptr<NativeMessagingChannel> channel,
+ scoped_ptr<extensions::NativeMessagingChannel> channel,
scoped_refptr<DaemonController> daemon_controller,
scoped_refptr<protocol::PairingRegistry> pairing_registry,
scoped_ptr<OAuthClient> oauth_client);
@@ -49,11 +49,11 @@ class Me2MeNativeMessagingHost {
void Start(const base::Closure& quit_closure);
- private:
- // Callback to process messages from the native messaging client through
- // |channel_|.
- void ProcessRequest(scoped_ptr<base::DictionaryValue> message);
+ // extensions::NativeMessagingChannel::EventHandler implementation
+ virtual void OnMessage(scoped_ptr<base::Value> message) OVERRIDE;
+ virtual void OnDisconnect() OVERRIDE;
+ private:
// 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).
@@ -144,7 +144,7 @@ class Me2MeNativeMessagingHost {
void DisconnectElevatedHost();
// Native messaging channel used to communicate with the elevated host.
- scoped_ptr<NativeMessagingChannel> elevated_channel_;
+ scoped_ptr<extensions::NativeMessagingChannel> elevated_channel_;
// Timer to control the lifetime of the elevated host.
base::OneShotTimer<Me2MeNativeMessagingHost> elevated_host_timer_;
@@ -159,7 +159,7 @@ class Me2MeNativeMessagingHost {
// Native messaging channel used to communicate with the native message
// client.
- scoped_ptr<NativeMessagingChannel> channel_;
+ scoped_ptr<extensions::NativeMessagingChannel> channel_;
scoped_refptr<DaemonController> daemon_controller_;
// Used to load and update the paired clients for this host.

Powered by Google App Engine
This is Rietveld 408576698