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

Unified Diff: chrome/browser/extensions/api/messaging/native_message_process_host.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
Index: chrome/browser/extensions/api/messaging/native_message_process_host.cc
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
index 749cb43c9f483c1f7936def9e097934bf50c11f0..dbede7913bf08177c5807acebe527e66e47ea85d 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc
@@ -13,6 +13,8 @@
#include "chrome/browser/extensions/api/messaging/native_process_launcher.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/features/feature.h"
+#include "content/public/browser/render_widget_host.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "extensions/common/constants.h"
#include "net/base/file_stream.h"
#include "net/base/io_buffer.h"
@@ -77,13 +79,20 @@ NativeMessageProcessHost::~NativeMessageProcessHost() {
// static
scoped_ptr<NativeMessageProcessHost> NativeMessageProcessHost::Create(
+ int source_process_id,
Sergey Ulanov 2013/08/07 22:51:20 instead of passing process_id and routing_id pair,
alexeypa (please no reviews) 2013/08/08 16:57:32 Done.
+ int source_routing_id,
base::WeakPtr<Client> weak_client_ui,
const std::string& source_extension_id,
const std::string& native_host_name,
int destination_port) {
+ // Get handle of the native view and pass it to the launcher. The launcher
+ // will later pass the handle to the native messaging host process.
+ gfx::NativeWindow native_view =
+ content::RenderWidgetHost::FromID(source_process_id, source_routing_id)->
+ GetView()->GetNativeView();
return CreateWithLauncher(weak_client_ui, source_extension_id,
native_host_name, destination_port,
- NativeProcessLauncher::CreateDefault());
+ NativeProcessLauncher::CreateDefault(native_view));
}
// static

Powered by Google App Engine
This is Rietveld 408576698