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

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

Issue 10868116: Pass result of blockage across content API when new tab blocked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_tabstrip.cc
===================================================================
--- chrome/browser/ui/browser_tabstrip.cc (revision 153532)
+++ chrome/browser/ui/browser_tabstrip.cc (working copy)
@@ -94,7 +94,7 @@
TabStripModel::ADD_ACTIVE);
}
-void AddWebContents(Browser* browser,
+bool AddWebContents(Browser* browser,
content::WebContents* source_contents,
content::WebContents* new_contents,
WindowOpenDisposition disposition,
@@ -118,24 +118,23 @@
}
if (source_tab_contents) {
- // Handle blocking of all contents.
+ // Handle blocking of tabs,
if (source_blocked_content->all_contents_blocked()) {
- source_blocked_content->AddTabContents(new_tab_contents,
- disposition,
- initial_pos,
- user_gesture);
- return;
+ source_blocked_content->AddTabContents(
+ new_tab_contents, disposition, initial_pos, user_gesture);
+ return false;
}
// Handle blocking of popups.
- if ((disposition == NEW_POPUP) && !user_gesture &&
+ if ((disposition == NEW_POPUP || disposition == NEW_FOREGROUND_TAB) &&
+ !user_gesture &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisablePopupBlocking)) {
// Unrequested popups from normal pages are constrained unless they're in
// the white list. The popup owner will handle checking this.
- source_tab_contents->blocked_content_tab_helper()->
- AddPopup(new_tab_contents, initial_pos, user_gesture);
- return;
+ source_blocked_content->AddPopup(
+ new_tab_contents, disposition, initial_pos, user_gesture);
+ return false;
}
new_contents->GetRenderViewHost()->DisassociateFromPopupCount();
@@ -149,6 +148,7 @@
params.window_action = NavigateParams::SHOW_WINDOW;
params.user_gesture = user_gesture;
Navigate(&params);
+ return true;
}
void CloseWebContents(Browser* browser, content::WebContents* contents) {

Powered by Google App Engine
This is Rietveld 408576698