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

Unified Diff: chrome/browser/extensions/api/messaging/message_service.cc

Issue 22532011: Pass handle of the native view window to the native messaging host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 7 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/messaging/native_message_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/messaging/message_service.cc
diff --git a/chrome/browser/extensions/api/messaging/message_service.cc b/chrome/browser/extensions/api/messaging/message_service.cc
index 65f74edd11fed2dc92af7e520d472f3bc32e2f6a..00e40f7eb03c132604c0b46838e07430c6b5d75d 100644
--- a/chrome/browser/extensions/api/messaging/message_service.cc
+++ b/chrome/browser/extensions/api/messaging/message_service.cc
@@ -34,6 +34,8 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "url/gurl.h"
@@ -321,8 +323,14 @@ void MessageService::OpenChannelToNativeApp(
channel->opener.reset(new ExtensionMessagePort(source, MSG_ROUTING_CONTROL,
source_extension_id));
+ // Get handle of the native view and pass it to the native messaging host.
+ gfx::NativeView native_view =
+ content::RenderWidgetHost::FromID(source_process_id, source_routing_id)->
+ GetView()->GetNativeView();
+
scoped_ptr<NativeMessageProcessHost> native_process =
NativeMessageProcessHost::Create(
+ native_view,
base::WeakPtr<NativeMessageProcessHost::Client>(
weak_factory_.GetWeakPtr()),
source_extension_id, native_app_name, receiver_port_id);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/messaging/native_message_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698