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

Unified Diff: chrome/renderer/extensions/runtime_custom_bindings.cc

Issue 14301016: Fix a couple of bugs relating to sending Tab info with chrome.runtime.connect and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add key to app1/manifest.json Created 7 years, 8 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/renderer/extensions/runtime_custom_bindings.cc
diff --git a/chrome/renderer/extensions/runtime_custom_bindings.cc b/chrome/renderer/extensions/runtime_custom_bindings.cc
index 96139f3a38746679a42a6640d6637733f65e0502..b41f43cc97c0d43a1e324e3dbc1d98bf93e702b9 100644
--- a/chrome/renderer/extensions/runtime_custom_bindings.cc
+++ b/chrome/renderer/extensions/runtime_custom_bindings.cc
@@ -14,6 +14,9 @@
#include "chrome/renderer/extensions/dispatcher.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/v8_value_converter.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
using content::V8ValueConverter;
@@ -50,16 +53,14 @@ v8::Handle<v8::Value> RuntimeCustomBindings::OpenChannelToExtension(
args[1]->IsString() &&
args[2]->IsString());
- std::string source_id = *v8::String::Utf8Value(args[0]->ToString());
- std::string target_id = *v8::String::Utf8Value(args[1]->ToString());
+ ExtensionMsg_ExternalConnectionInfo info;
+ info.source_id = *v8::String::Utf8Value(args[0]->ToString());
+ info.target_id = *v8::String::Utf8Value(args[1]->ToString());
+ info.source_url = renderview->GetWebView()->mainFrame()->document().url();
std::string channel_name = *v8::String::Utf8Value(args[2]->ToString());
int port_id = -1;
renderview->Send(new ExtensionHostMsg_OpenChannelToExtension(
- renderview->GetRoutingID(),
- source_id,
- target_id,
- channel_name,
- &port_id));
+ renderview->GetRoutingID(), info, channel_name, &port_id));
return v8::Integer::New(port_id);
}
« no previous file with comments | « chrome/renderer/extensions/miscellaneous_bindings.cc ('k') | chrome/renderer/resources/extensions/miscellaneous_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698