Chromium Code Reviews| Index: content/browser/browser_plugin/browser_plugin_guest.cc |
| diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
| index 5848fb269124f4b0e87e1571ae602e1a7b3395b9..dc802fb201d1baa68be96f5d0bb3adb39903522a 100644 |
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc |
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
| @@ -115,6 +115,13 @@ void BrowserPluginGuest::Destroy() { |
| delegate_->Destroy(); |
| } |
| +WebContentsImpl* BrowserPluginGuest::CreateNewGuestWindow( |
| + WebContents::CreateParams* params) { |
| + if (!delegate_) |
|
lazyboy
2014/06/17 23:46:46
This would pretty much result in null pointer exce
Fady Samuel
2014/06/18 21:08:34
I've made delegate a part of the constructor. Now
lazyboy
2014/06/19 16:17:31
That's great.
Can you also update your CL descript
Fady Samuel
2014/06/20 15:16:35
Done.
|
| + return NULL; |
| + return static_cast<WebContentsImpl*>(delegate_->CreateNewGuestWindow(params)); |
| +} |
| + |
| bool BrowserPluginGuest::OnMessageReceivedFromEmbedder( |
| const IPC::Message& message) { |
| bool handled = true; |
| @@ -239,27 +246,12 @@ BrowserPluginGuest::~BrowserPluginGuest() { |
| // static |
| BrowserPluginGuest* BrowserPluginGuest::Create( |
| int instance_id, |
| - SiteInstance* guest_site_instance, |
| WebContentsImpl* web_contents, |
| - scoped_ptr<base::DictionaryValue> extra_params, |
| - BrowserPluginGuest* opener) { |
| + BrowserPluginGuestDelegate* delegate) { |
| RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Create")); |
| BrowserPluginGuest* guest = new BrowserPluginGuest( |
| instance_id, web_contents->opener() != NULL, web_contents); |
| web_contents->SetBrowserPluginGuest(guest); |
| - WebContents* opener_web_contents = NULL; |
| - if (opener) { |
| - opener_web_contents = opener->GetWebContents(); |
| - guest_site_instance = opener_web_contents->GetSiteInstance(); |
| - } |
| - BrowserPluginGuestDelegate* delegate = NULL; |
| - GetContentClient()->browser()->GuestWebContentsCreated( |
| - instance_id, |
| - guest_site_instance, |
| - web_contents, |
| - opener_web_contents, |
| - &delegate, |
| - extra_params.Pass()); |
| if (delegate) { |
| delegate->RegisterDestructionCallback( |
| base::Bind(&BrowserPluginGuest::WillDestroy, |