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

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

Issue 20924002: Try to restore window.opener when opening blocked popups (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 5 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
« no previous file with comments | « chrome/browser/ui/browser_navigator.h ('k') | chrome/test/data/popup_blocker/check-opener.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_navigator.cc
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 72505692db50fb265dc6bf352d0ffa1524e72157..51a674bae4224718e6aafc78b2b8831e733ca0a9 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -320,6 +320,8 @@ content::WebContents* CreateTargetContents(const chrome::NavigateParams& params,
if (params.source_contents) {
create_params.initial_size =
params.source_contents->GetView()->GetContainerSize();
+ if (params.should_set_opener)
+ create_params.opener = params.source_contents;
}
#if defined(USE_AURA)
if (params.browser->window() &&
@@ -329,7 +331,8 @@ content::WebContents* CreateTargetContents(const chrome::NavigateParams& params,
}
#endif
- content::WebContents* target_contents = WebContents::Create(create_params);
+ WebContents* target_contents = WebContents::Create(create_params);
+
// New tabs can have WebUI URLs that will make calls back to arbitrary
// tab helpers, so the entire set of tab helpers needs to be set up
// immediately.
@@ -393,7 +396,8 @@ NavigateParams::NavigateParams(Browser* a_browser,
browser(a_browser),
initiating_profile(NULL),
host_desktop_type(GetHostDesktop(a_browser)),
- should_replace_current_entry(false) {
+ should_replace_current_entry(false),
+ should_set_opener(false) {
}
NavigateParams::NavigateParams(Browser* a_browser,
@@ -412,7 +416,8 @@ NavigateParams::NavigateParams(Browser* a_browser,
browser(a_browser),
initiating_profile(NULL),
host_desktop_type(GetHostDesktop(a_browser)),
- should_replace_current_entry(false) {
+ should_replace_current_entry(false),
+ should_set_opener(false) {
}
NavigateParams::NavigateParams(Profile* a_profile,
@@ -433,7 +438,8 @@ NavigateParams::NavigateParams(Profile* a_profile,
browser(NULL),
initiating_profile(a_profile),
host_desktop_type(chrome::GetActiveDesktop()),
- should_replace_current_entry(false) {
+ should_replace_current_entry(false),
+ should_set_opener(false) {
}
NavigateParams::~NavigateParams() {}
« no previous file with comments | « chrome/browser/ui/browser_navigator.h ('k') | chrome/test/data/popup_blocker/check-opener.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698