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); |