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

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
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..0b7d3902ac31e127bb519f1b99a59004d02aef4f 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -329,7 +329,9 @@ content::WebContents* CreateTargetContents(const chrome::NavigateParams& params,
}
#endif
- content::WebContents* target_contents = WebContents::Create(create_params);
+ WebContents* target_contents = WebContents::Create(
+ create_params, params.should_set_opener ? params.source_contents : NULL);
+
// 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 +395,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 +415,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 +437,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() {}

Powered by Google App Engine
This is Rietveld 408576698