diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 00:53:07 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 00:53:07 +0000 |
commit | 883be7eb6ca869a87fa23e264a1a9905105c750e (patch) | |
tree | a23d5b466744a9bcb340c50d4e52c89f43f58101 /chrome_frame/http_negotiate.cc | |
parent | 096f7353ece3c42af366ed4fa2f451d6e826aa5c (diff) | |
download | chromium_src-883be7eb6ca869a87fa23e264a1a9905105c750e.zip chromium_src-883be7eb6ca869a87fa23e264a1a9905105c750e.tar.gz chromium_src-883be7eb6ca869a87fa23e264a1a9905105c750e.tar.bz2 |
Check if the url is a top level url before clearing the referrer header.
TEST=n/a
BUG=none
Review URL: http://codereview.chromium.org/1745007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/http_negotiate.cc')
-rw-r--r-- | chrome_frame/http_negotiate.cc | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc index 4cc1a7d..37fcf2f 100644 --- a/chrome_frame/http_negotiate.cc +++ b/chrome_frame/http_negotiate.cc @@ -203,19 +203,17 @@ HRESULT HttpNegotiatePatch::BeginningTransaction( return hr; } - ScopedComPtr<IWebBrowser2> browser2; - DoQueryService(IID_ITargetFrame2, me, browser2.Receive()); - if (browser2) { - VARIANT_BOOL is_top_level = VARIANT_FALSE; - browser2->get_TopLevelContainer(&is_top_level); - - DLOG(INFO) << "called OnBeginningTransaction " << is_top_level; - - if (is_top_level != VARIANT_FALSE) { - std::string referrer = FindReferrerFromHeaders(headers, - *additional_headers); - NavigationManager* mgr = NavigationManager::GetThreadInstance(); - if (mgr) { + NavigationManager* mgr = NavigationManager::GetThreadInstance(); + if (mgr && mgr->IsTopLevelUrl(url)) { + ScopedComPtr<IWebBrowser2> browser2; + DoQueryService(IID_ITargetFrame2, me, browser2.Receive()); + if (browser2) { + VARIANT_BOOL is_top_level = VARIANT_FALSE; + browser2->get_TopLevelContainer(&is_top_level); + + if (is_top_level != VARIANT_FALSE) { + std::string referrer = FindReferrerFromHeaders(headers, + *additional_headers); // When we switch from IE to CF the BeginningTransaction function is // called twice. The first call contains the referrer while the // second call does not. We set the referrer only if the URL in the @@ -225,12 +223,12 @@ HRESULT HttpNegotiatePatch::BeginningTransaction( DCHECK(mgr->referrer().empty()); mgr->set_referrer(referrer); } - } else { - DLOG(INFO) << "No NavigationManager"; } + } else { + DLOG(INFO) << "No IWebBrowser2"; } } else { - DLOG(INFO) << "No IWebBrowser2"; + DLOG(INFO) << "No NavigationManager"; } static const char kLowerCaseUserAgent[] = "user-agent"; |