From 3b0a45e85c70e42e208780433c84ddd99e672053 Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Mon, 13 Oct 2008 21:01:03 +0000 Subject: Popups opened from popups should be constrained and subject to constrained popup limits. This solves the UI issue, but there's still the backend stuff which I've filled as http://crbug.com/3382 BUG=2632 Review URL: http://codereview.chromium.org/7233 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3313 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/tab_contents.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'chrome/browser/tab_contents.cc') diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc index f323524..44de4ab 100644 --- a/chrome/browser/tab_contents.cc +++ b/chrome/browser/tab_contents.cc @@ -266,13 +266,13 @@ void TabContents::AddNewContents(TabContents* new_contents, if (!delegate_) return; - if ((disposition == NEW_POPUP) && !delegate_->IsPopup(this)) { - if (user_gesture) { - delegate_->AddNewContents(this, new_contents, disposition, initial_pos, - user_gesture); - } else { - AddConstrainedPopup(new_contents, initial_pos); - } + if ((disposition == NEW_POPUP) && !user_gesture) { + // Unrequested popups from normal pages are constrained. + TabContents* popup_owner = this; + TabContents* our_owner = delegate_->GetConstrainingContents(this); + if (our_owner) + popup_owner = our_owner; + popup_owner->AddConstrainedPopup(new_contents, initial_pos); } else { delegate_->AddNewContents(this, new_contents, disposition, initial_pos, user_gesture); -- cgit v1.1