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 693342e723723ff19455fcb5416fffd1109cd844..3f977ad868fae14f2eb0f9b02d2405ec8de3e448 100644 |
| --- a/content/browser/browser_plugin/browser_plugin_guest.cc |
| +++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
| @@ -10,7 +10,6 @@ |
| #include "base/strings/string_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| -#include "content/browser/browser_plugin/browser_plugin_guest_manager.h" |
| #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
| #include "content/browser/browser_thread_impl.h" |
| #include "content/browser/child_process_security_policy_impl.h" |
| @@ -30,6 +29,7 @@ |
| #include "content/common/view_messages.h" |
| #include "content/port/browser/render_view_host_delegate_view.h" |
| #include "content/public/browser/browser_context.h" |
| +#include "content/public/browser/browser_plugin_guest_manager_delegate.h" |
| #include "content/public/browser/content_browser_client.h" |
| #include "content/public/browser/navigation_controller.h" |
| #include "content/public/browser/render_widget_host_view.h" |
| @@ -111,12 +111,15 @@ class BrowserPluginGuest::NewWindowRequest : public PermissionRequest { |
| virtual ~NewWindowRequest() {} |
| void RespondInternal(bool should_allow, |
| - BrowserPluginGuest* guest) { |
| - if (!guest) { |
| + WebContents* guest_web_contents) { |
| + if (!guest_web_contents) { |
| VLOG(0) << "Guest not found. Instance ID: " << instance_id_; |
| return; |
| } |
| + BrowserPluginGuest* guest = |
| + static_cast<WebContentsImpl*>(guest_web_contents)-> |
| + GetBrowserPluginGuest(); |
|
lazyboy
2014/05/05 21:40:54
DCHECK(guest)?
Fady Samuel
2014/05/07 17:32:59
Done.
|
| // If we do not destroy the guest then we allow the new window. |
| if (!should_allow) |
| guest->Destroy(); |
| @@ -306,7 +309,8 @@ void BrowserPluginGuest::RequestPermission( |
| BrowserPluginGuest* BrowserPluginGuest::CreateNewGuestWindow( |
| const OpenURLParams& params) { |
| - BrowserPluginGuestManager* guest_manager = GetBrowserPluginGuestManager(); |
| + BrowserPluginGuestManagerDelegate* guest_manager = |
| + GetBrowserPluginGuestManager(); |
| // Allocate a new instance ID for the new guest. |
| int instance_id = guest_manager->GetNextInstanceID(); |
| @@ -324,11 +328,14 @@ BrowserPluginGuest* BrowserPluginGuest::CreateNewGuestWindow( |
| storage_info.partition_id = site_url.query(); |
| storage_info.persist = |
| site_url.path().find("persist") != std::string::npos; |
| - BrowserPluginGuest* new_guest = |
| + WebContents* new_guest_web_contents = |
| guest_manager->CreateGuest(GetWebContents()->GetSiteInstance(), |
| instance_id, |
| storage_info, |
| extra_params.Pass()); |
| + BrowserPluginGuest* new_guest = |
| + static_cast<WebContentsImpl*>(new_guest_web_contents)-> |
| + GetBrowserPluginGuest(); |
| if (new_guest->delegate_) |
| new_guest->delegate_->SetOpener(GetWebContents()); |
| @@ -574,10 +581,9 @@ void BrowserPluginGuest::CopyFromCompositingSurface( |
| copy_request_id_, src_subrect, dst_size)); |
| } |
| -BrowserPluginGuestManager* |
| +BrowserPluginGuestManagerDelegate* |
| BrowserPluginGuest::GetBrowserPluginGuestManager() const { |
| - return BrowserPluginGuestManager::FromBrowserContext( |
| - GetWebContents()->GetBrowserContext()); |
| + return GetWebContents()->GetBrowserContext()->GetGuestManagerDelegate(); |
| } |
| // screen. |