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

Unified Diff: content/public/browser/web_contents_delegate.h

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: content/public/browser/web_contents_delegate.h
===================================================================
--- content/public/browser/web_contents_delegate.h (revision 153532)
+++ content/public/browser/web_contents_delegate.h (working copy)
@@ -95,12 +95,12 @@
// Creates a new tab with the already-created WebContents 'new_contents'.
// The window for the added contents should be reparented correctly when this
// method returns. If |disposition| is NEW_POPUP, |pos| should hold the
- // initial position.
- virtual void AddNewContents(WebContents* source,
+ // initial position. Returns false if the tab is blocked.
+ virtual bool AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
const gfx::Rect& initial_pos,
- bool user_gesture) {}
+ bool user_gesture) { return true; }
// Selects the specified contents, bringing its container to the front.
virtual void ActivateContents(WebContents* contents) {}
@@ -297,11 +297,12 @@
const GURL& target_url);
// Notifies the delegate about the creation of a new WebContents. This
- // typically happens when popups are created.
- virtual void WebContentsCreated(WebContents* source_contents,
+ // typically happens when popups are created. Returns false if the delegate
+ // chooses to block the popup.
+ virtual bool WebContentsCreated(WebContents* source_contents,
int64 source_frame_id,
const GURL& target_url,
- WebContents* new_contents) {}
+ WebContents* new_contents) { return true; }
jam 2012/08/29 00:07:23 nit: you will get clang errors for this, you need
// Notifies the delegate that the content restrictions for this tab has
// changed.

Powered by Google App Engine
This is Rietveld 408576698