Chromium Code Reviews| 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 9e4b961fab575f9c315e6383da1c0533ac49a027..cb532236035ae2e576f38af37311a136c3e7babd 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), |
| + content_window_routing_id_(MSG_ROUTING_NONE), |
| visible_(true), |
| current_nav_entry_index_(0), |
| nav_entry_count_(0) { |
| @@ -142,6 +143,17 @@ void BrowserPlugin::SetSrcAttribute(const std::string& src) { |
| guest_crashed_ = false; |
| } |
| +NPObject* BrowserPlugin::GetContentWindow() const { |
|
abarth-chromium
2012/10/16 18:47:27
This function LGTM
Fady Samuel
2012/10/16 19:17:08
Thanks Adam.
|
| + if (content_window_routing_id_ == MSG_ROUTING_NONE) |
| + return NULL; |
| + RenderViewImpl* guest_render_view = static_cast<RenderViewImpl*>( |
| + ChildThread::current()->ResolveRoute(content_window_routing_id_)); |
| + if (!guest_render_view) |
| + return NULL; |
| + WebKit::WebFrame* guest_frame = guest_render_view->GetWebView()->mainFrame(); |
| + return guest_frame->windowObject(); |
| +} |
| + |
| std::string BrowserPlugin::GetPartitionAttribute() const { |
| std::string value; |
| if (persist_storage_) |
| @@ -493,6 +505,11 @@ void BrowserPlugin::AdvanceFocus(bool reverse) { |
| render_view_->GetWebView()->advanceFocus(reverse); |
| } |
| +void BrowserPlugin::GuestContentWindowReady(int content_window_routing_id) { |
| + DCHECK(content_window_routing_id != MSG_ROUTING_NONE); |
| + content_window_routing_id_ = content_window_routing_id; |
| +} |
| + |
| void BrowserPlugin::SetAcceptTouchEvents(bool accept) { |
| if (container()) |
| container()->setIsAcceptingTouchEvents(accept); |