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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 336283002: Remove GuestWebContentsCreated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplify_creation
Patch Set: Fixed lifetime Created 6 years, 6 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/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,

Powered by Google App Engine
This is Rietveld 408576698