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

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need to rename addEventListener/removeEventListener Created 8 years, 2 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: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index c5c4f292dc25661107d5e8fbec352fe262452c56..c28aaff56a24c69c8426e0fbfe9b8505d39f6bad 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -72,6 +72,7 @@ BrowserPlugin::BrowserPlugin(
navigate_src_sent_(false),
process_id_(-1),
persist_storage_(false),
+ guest_routing_id_(MSG_ROUTING_NONE),
visible_(true) {
BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this);
bindings_.reset(new BrowserPluginBindings(this));
@@ -140,6 +141,17 @@ void BrowserPlugin::SetSrcAttribute(const std::string& src) {
guest_crashed_ = false;
}
+NPObject* BrowserPlugin::GetContentWindow() const {
+ if (guest_routing_id_ == MSG_ROUTING_NONE)
+ return NULL;
+ RenderViewImpl* guest_render_view = static_cast<RenderViewImpl*>(
+ ChildThread::current()->ResolveRoute(guest_routing_id_));
Charlie Reis 2012/10/12 00:31:43 nit: wrong indent.
Fady Samuel 2012/10/12 18:07:53 Done.
+ if (!guest_render_view)
+ return NULL;
+ WebKit::WebFrame* guest_frame = guest_render_view->GetWebView()->mainFrame();
+ return guest_frame->windowObject();
Charlie Reis 2012/10/12 00:31:43 This is beyond my knowledge. Is it safe to return
Fady Samuel 2012/10/12 18:07:53 I will ask abarth@ to at a look at BrowserPlugin::
+}
+
std::string BrowserPlugin::GetPartitionAttribute() const {
std::string value;
if (persist_storage_)
@@ -469,6 +481,11 @@ void BrowserPlugin::AdvanceFocus(bool reverse) {
render_view_->GetWebView()->advanceFocus(reverse);
}
+void BrowserPlugin::GuestContentWindowReady(int guest_routing_id) {
+ DCHECK(guest_routing_id != MSG_ROUTING_NONE);
+ guest_routing_id_ = guest_routing_id;
+}
+
void BrowserPlugin::SetAcceptTouchEvents(bool accept) {
if (container())
container()->setIsAcceptingTouchEvents(accept);

Powered by Google App Engine
This is Rietveld 408576698