diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-28 19:36:58 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-28 19:36:58 +0000 |
commit | 6f52608ef9e1f21b7c06c3f9e434345e2fe4f07d (patch) | |
tree | d6a6b4ac005e2ded255b240a6c04b0592b333d70 /chrome/browser/external_tab_container.cc | |
parent | d1ba5b511c94fb02b79ceae67a172d6bdb716e98 (diff) | |
download | chromium_src-6f52608ef9e1f21b7c06c3f9e434345e2fe4f07d.zip chromium_src-6f52608ef9e1f21b7c06c3f9e434345e2fe4f07d.tar.gz chromium_src-6f52608ef9e1f21b7c06c3f9e434345e2fe4f07d.tar.bz2 |
Window.open calls issued by pages within ChromeFrame which use the NEW_WINDOW/NEW_POPUP
dispositions open up as regular Chrome windows, which results in them not using the host network stack,
which means that HTTP sessions/cookies, etc established by the main page will not work for the popup.
Fix is to ensure that these dispositions also get routed back to the host browser where a new tab
would be created which would attach itself to the newly created ExternalTabContainer instance.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=33324
Bug=33324
Test=Covered by ChromeFrame unit test.
Review URL: http://codereview.chromium.org/549183
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.cc')
-rw-r--r-- | chrome/browser/external_tab_container.cc | 76 |
1 files changed, 29 insertions, 47 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index 8ec811c..bb3f603 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -311,53 +311,35 @@ void ExternalTabContainer::AddNewContents(TabContents* source, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - switch (disposition) { - case NEW_POPUP: - case NEW_WINDOW: { - Browser::BuildPopupWindowHelper(source, new_contents, initial_pos, - Browser::TYPE_POPUP, - tab_contents_->profile(), true); - break; - } - - case NEW_FOREGROUND_TAB: - case NEW_BACKGROUND_TAB: { - DCHECK(automation_ != NULL); - - scoped_refptr<ExternalTabContainer> new_container = - new ExternalTabContainer(NULL, NULL); - - // Make sure that ExternalTabContainer instance is initialized with - // an unwrapped Profile. - bool result = new_container->Init( - new_contents->profile()->GetOriginalProfile(), - NULL, - initial_pos, - WS_CHILD, - load_requests_via_automation_, - handle_top_level_requests_, - new_contents, - GURL(), - GURL()); - - if (result) { - pending_tabs_[reinterpret_cast<intptr_t>(new_container.get())] = - new_container; - - automation_->Send(new AutomationMsg_AttachExternalTab( - 0, - tab_handle_, - reinterpret_cast<intptr_t>(new_container.get()), - disposition)); - } else { - NOTREACHED(); - } - break; - } - - default: - NOTREACHED(); - break; + DCHECK(automation_ != NULL); + + scoped_refptr<ExternalTabContainer> new_container = + new ExternalTabContainer(NULL, NULL); + + // Make sure that ExternalTabContainer instance is initialized with + // an unwrapped Profile. + bool result = new_container->Init( + new_contents->profile()->GetOriginalProfile(), + NULL, + initial_pos, + WS_CHILD, + load_requests_via_automation_, + handle_top_level_requests_, + new_contents, + GURL(), + GURL()); + + if (result) { + pending_tabs_[reinterpret_cast<intptr_t>(new_container.get())] = + new_container; + + automation_->Send(new AutomationMsg_AttachExternalTab( + 0, + tab_handle_, + reinterpret_cast<intptr_t>(new_container.get()), + disposition)); + } else { + NOTREACHED(); } } |