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

Unified Diff: chrome/browser/ui/browser.cc

Issue 2882513005: Propagate opener to BackgroundsContents. (Closed)
Patch Set: Tweaked the comment in DriveWebContentsManager::ShouldCreateWebContents Created 3 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: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 87bda12a8864d1a21c8cc277d822862a03c026f2..71d426d16add014f7860e4ca21de00929039a3a7 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1675,6 +1675,7 @@ void Browser::ShowRepostFormWarningDialog(WebContents* source) {
bool Browser::ShouldCreateWebContents(
content::WebContents* web_contents,
+ content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
int32_t route_id,
int32_t main_frame_route_id,
@@ -1689,7 +1690,7 @@ bool Browser::ShouldCreateWebContents(
content::mojom::WindowContainerType::BACKGROUND) {
// If a BackgroundContents is created, suppress the normal WebContents.
return !MaybeCreateBackgroundContents(
- source_site_instance, opener_url, route_id, main_frame_route_id,
+ source_site_instance, opener, opener_url, route_id, main_frame_route_id,
main_frame_widget_route_id, frame_name, target_url, partition_id,
session_storage_namespace);
}
@@ -2551,6 +2552,7 @@ bool Browser::ShouldStartShutdown() const {
bool Browser::MaybeCreateBackgroundContents(
content::SiteInstance* source_site_instance,
+ content::RenderFrameHost* opener,
const GURL& opener_url,
int32_t route_id,
int32_t main_frame_route_id,
@@ -2608,7 +2610,7 @@ bool Browser::MaybeCreateBackgroundContents(
BackgroundContents* contents = nullptr;
if (allow_js_access) {
contents = service->CreateBackgroundContents(
- source_site_instance, route_id, main_frame_route_id,
+ source_site_instance, opener, route_id, main_frame_route_id,
main_frame_widget_route_id, profile_, frame_name,
base::ASCIIToUTF16(extension->id()), partition_id,
session_storage_namespace);
@@ -2620,7 +2622,7 @@ bool Browser::MaybeCreateBackgroundContents(
contents = service->CreateBackgroundContents(
content::SiteInstance::Create(
source_site_instance->GetBrowserContext()),
- MSG_ROUTING_NONE, MSG_ROUTING_NONE, MSG_ROUTING_NONE, profile_,
+ nullptr, MSG_ROUTING_NONE, MSG_ROUTING_NONE, MSG_ROUTING_NONE, profile_,
frame_name, base::ASCIIToUTF16(extension->id()), partition_id,
session_storage_namespace);
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | components/offline_pages/content/background_loader/background_loader_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698