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

Side by Side Diff: chrome/browser/ui/blocked_content/popup_blocker_tab_helper.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, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" 5 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
6 6
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/content_settings/host_content_settings_map.h" 8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 chrome::NavigateParams nav_params( 102 chrome::NavigateParams nav_params(
103 Profile::FromBrowserContext(web_contents()->GetBrowserContext()), 103 Profile::FromBrowserContext(web_contents()->GetBrowserContext()),
104 target_url, 104 target_url,
105 content::PAGE_TRANSITION_LINK); 105 content::PAGE_TRANSITION_LINK);
106 nav_params.referrer = referrer; 106 nav_params.referrer = referrer;
107 nav_params.source_contents = web_contents(); 107 nav_params.source_contents = web_contents();
108 nav_params.is_renderer_initiated = true; 108 nav_params.is_renderer_initiated = true;
109 nav_params.tabstrip_add_types = TabStripModel::ADD_ACTIVE; 109 nav_params.tabstrip_add_types = TabStripModel::ADD_ACTIVE;
110 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW; 110 nav_params.window_action = chrome::NavigateParams::SHOW_WINDOW;
111 nav_params.user_gesture = user_gesture; 111 nav_params.user_gesture = user_gesture;
112 nav_params.should_set_opener = !opener_suppressed;
Charlie Reis 2013/08/01 18:13:34 What if we just had a nav_params.opener_contents t
jochen (gone - plz use gerrit) 2013/08/01 19:48:51 chrome::NavigateParams already has source_contents
112 web_contents()->GetView()->GetContainerBounds(&nav_params.window_bounds); 113 web_contents()->GetView()->GetContainerBounds(&nav_params.window_bounds);
113 if (features.xSet) 114 if (features.xSet)
114 nav_params.window_bounds.set_x(features.x); 115 nav_params.window_bounds.set_x(features.x);
115 if (features.ySet) 116 if (features.ySet)
116 nav_params.window_bounds.set_y(features.y); 117 nav_params.window_bounds.set_y(features.y);
117 if (features.widthSet) 118 if (features.widthSet)
118 nav_params.window_bounds.set_width(features.width); 119 nav_params.window_bounds.set_width(features.width);
119 if (features.heightSet) 120 if (features.heightSet)
120 nav_params.window_bounds.set_height(features.height); 121 nav_params.window_bounds.set_height(features.height);
121 122
(...skipping 29 matching lines...) Expand all
151 std::map<int32, GURL> PopupBlockerTabHelper::GetBlockedPopupRequests() { 152 std::map<int32, GURL> PopupBlockerTabHelper::GetBlockedPopupRequests() {
152 std::map<int32, GURL> result; 153 std::map<int32, GURL> result;
153 for (IDMap<BlockedRequest, IDMapOwnPointer>::const_iterator iter( 154 for (IDMap<BlockedRequest, IDMapOwnPointer>::const_iterator iter(
154 &blocked_popups_); 155 &blocked_popups_);
155 !iter.IsAtEnd(); 156 !iter.IsAtEnd();
156 iter.Advance()) { 157 iter.Advance()) {
157 result[iter.GetCurrentKey()] = iter.GetCurrentValue()->params.url; 158 result[iter.GetCurrentKey()] = iter.GetCurrentValue()->params.url;
158 } 159 }
159 return result; 160 return result;
160 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698