summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authordominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-13 20:05:14 +0000
committerdominich@chromium.org <dominich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-13 20:05:14 +0000
commitbbbe5d7dd70dabe0d728e789326879e02f63d040 (patch)
treebd7fe778d2b05c603544c0681a1e5db71a08a62d /content
parent6f6a5c5fcf68ff9715593153762f0f59a0c9ea14 (diff)
downloadchromium_src-bbbe5d7dd70dabe0d728e789326879e02f63d040.zip
chromium_src-bbbe5d7dd70dabe0d728e789326879e02f63d040.tar.gz
chromium_src-bbbe5d7dd70dabe0d728e789326879e02f63d040.tar.bz2
Block the creation of a new window when prerendering.
BUG=none TEST=PrerenderBrowserTest.PrerenderPopup Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=84922 Review URL: http://codereview.chromium.org/6955003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85308 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/tab_contents/tab_contents_view.cc5
-rw-r--r--content/common/notification_type.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/content/browser/tab_contents/tab_contents_view.cc b/content/browser/tab_contents/tab_contents_view.cc
index 79ee406..4ea5d9b 100644
--- a/content/browser/tab_contents/tab_contents_view.cc
+++ b/content/browser/tab_contents/tab_contents_view.cc
@@ -50,6 +50,11 @@ void TabContentsView::CreateNewWindow(
if (tab_contents_->delegate())
tab_contents_->delegate()->TabContentsCreated(new_contents);
+ } else {
+ NotificationService::current()->Notify(
+ NotificationType::CREATING_NEW_WINDOW_CANCELLED,
+ Source<TabContents>(tab_contents_),
+ Details<const ViewHostMsg_CreateWindow_Params>(&params));
}
}
diff --git a/content/common/notification_type.h b/content/common/notification_type.h
index c7e4d6a..7f57c50 100644
--- a/content/common/notification_type.h
+++ b/content/common/notification_type.h
@@ -131,6 +131,12 @@ class NotificationType {
// ViewHostMsg_CreateWindow_Params object are provided.
CREATING_NEW_WINDOW,
+ // A new window was requested but was not created. The source will be a
+ // Source<TabContents> corresponding to the tab the request originated from.
+ // Details are the ViewHostMsg_CreateWindow_Params object that were used in
+ // the request.
+ CREATING_NEW_WINDOW_CANCELLED,
+
// SSL ---------------------------------------------------------------------
// Updating the SSL security indicators (the lock icon and such) proceeds