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_frame/chrome_active_document.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_frame/chrome_active_document.cc')
-rw-r--r-- | chrome_frame/chrome_active_document.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc index e92aa0b..553b46f 100644 --- a/chrome_frame/chrome_active_document.cc +++ b/chrome_frame/chrome_active_document.cc @@ -578,9 +578,18 @@ void ChromeActiveDocument::UpdateNavigationState( // that only happen within Chrome such as anchor navigations) we need to // update IE's internal state after the fact. In the case of internal // navigations, we notify the BHOs but ignore the should_cancel flag. - bool is_internal_navigation = (new_navigation_info.navigation_index > 0) && + + // Another case where we need to issue BeforeNavigate2 calls is as below:- + // We get notified after the fact, when navigations are initiated within + // Chrome via window.open calls. These navigations are handled by creating + // an external tab container within chrome and then connecting to it from IE. + // We still want to update the address bar/history, etc, to ensure that + // the special URL used by Chrome to indicate this is updated correctly. + bool is_internal_navigation = ((new_navigation_info.navigation_index > 0) && (new_navigation_info.navigation_index != - navigation_info_.navigation_index); + navigation_info_.navigation_index)) || + StartsWith(static_cast<BSTR>(url_), kChromeAttachExternalTabPrefix, + false); if (new_navigation_info.url.is_valid()) { url_.Allocate(UTF8ToWide(new_navigation_info.url.spec()).c_str()); @@ -830,6 +839,8 @@ bool ChromeActiveDocument::ParseUrl(const std::wstring& url, bool ChromeActiveDocument::LaunchUrl(const std::wstring& url, bool is_new_navigation) { + url_.Reset(::SysAllocString(url.c_str())); + if (!is_new_navigation) { WStringTokenizer tokenizer(url, L"&"); // Skip over kChromeAttachExternalTabPrefix @@ -850,7 +861,6 @@ bool ChromeActiveDocument::LaunchUrl(const std::wstring& url, } else { // Initiate navigation before launching chrome so that the url will be // cached and sent with launch settings. - url_.Reset(::SysAllocString(url.c_str())); if (url_.Length()) { std::string utf8_url; WideToUTF8(url_, url_.Length(), &utf8_url); |