diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-13 21:01:03 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-13 21:01:03 +0000 |
commit | 3b0a45e85c70e42e208780433c84ddd99e672053 (patch) | |
tree | 4bac206629a2e551d66ccb4574935d4854eb40b1 /chrome/browser | |
parent | 37354560190cee32e18bcaf60e8db328d3ca319e (diff) | |
download | chromium_src-3b0a45e85c70e42e208780433c84ddd99e672053.zip chromium_src-3b0a45e85c70e42e208780433c84ddd99e672053.tar.gz chromium_src-3b0a45e85c70e42e208780433c84ddd99e672053.tar.bz2 |
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
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/tab_contents.cc | 14 |
1 files changed, 7 insertions, 7 deletions
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); |