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

Unified Diff: chrome/browser/ui/blocked_content/blocked_content_container.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, 3 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/blocked_content/blocked_content_container.cc
===================================================================
--- chrome/browser/ui/blocked_content/blocked_content_container.cc (revision 154977)
+++ chrome/browser/ui/blocked_content/blocked_content_container.cc (working copy)
@@ -75,11 +75,15 @@
tab_contents->blocked_content_tab_helper()->set_delegate(NULL);
// We needn't call WasShown to change its status because the
// WebContents::AddNewContents will do it.
- owner_->web_contents()->AddNewContents(
- tab_contents->web_contents(),
- content.disposition,
- content.bounds,
- content.user_gesture);
+ WebContentsDelegate* delegate = owner_->web_contents()->GetDelegate();
+ if (delegate) {
+ delegate->AddNewContents(owner_->web_contents(),
+ tab_contents->web_contents(),
+ content.disposition,
+ content.bounds,
+ content.user_gesture,
+ NULL);
+ }
break;
}
}
@@ -120,9 +124,13 @@
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_position,
- bool user_gesture) {
- owner_->web_contents()->AddNewContents(
- new_contents, disposition, initial_position, user_gesture);
+ bool user_gesture,
+ bool* was_blocked) {
+ WebContentsDelegate* delegate = owner_->web_contents()->GetDelegate();
+ if (delegate) {
+ delegate->AddNewContents(owner_->web_contents(), new_contents, disposition,
+ initial_position, user_gesture, was_blocked);
+ }
}
void BlockedContentContainer::CloseContents(WebContents* source) {

Powered by Google App Engine
This is Rietveld 408576698