summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_active_document.cc
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 21:48:25 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 21:48:25 +0000
commitc5cbf4e32dbadb45aaac6e7f5dc076382f7054a7 (patch)
treed7074f9e9b9f11246033c85daa70bed3b299a595 /chrome_frame/chrome_active_document.cc
parent9b9423cfaa6c65400634b6e86b41f1a524a2f8c4 (diff)
downloadchromium_src-c5cbf4e32dbadb45aaac6e7f5dc076382f7054a7.zip
chromium_src-c5cbf4e32dbadb45aaac6e7f5dc076382f7054a7.tar.gz
chromium_src-c5cbf4e32dbadb45aaac6e7f5dc076382f7054a7.tar.bz2
Small refactoring in preparation of the assassination of HttpNegotiate patch (and possible murder of NavigationManager).
Review URL: http://codereview.chromium.org/2813053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52547 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_active_document.cc')
-rw-r--r--chrome_frame/chrome_active_document.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index 662e459..fc896a0 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -264,7 +264,8 @@ STDMETHODIMP ChromeActiveDocument::Load(BOOL fully_avalable,
return E_INVALIDARG;
}
- if (!LaunchUrl(url, is_new_navigation)) {
+ const std::string& referrer = mgr ? mgr->referrer() : EmptyString();
+ if (!LaunchUrl(url, referrer, is_new_navigation)) {
NOTREACHED() << __FUNCTION__ << " Failed to launch url:" << url;
return E_INVALIDARG;
}
@@ -369,7 +370,8 @@ STDMETHODIMP ChromeActiveDocument::LoadHistory(IStream* stream,
return E_INVALIDARG;
}
- if (!LaunchUrl(url, is_new_navigation)) {
+ const std::string& referrer = EmptyString();
+ if (!LaunchUrl(url, referrer, is_new_navigation)) {
NOTREACHED() << __FUNCTION__ << " Failed to launch url:" << url;
return E_INVALIDARG;
}
@@ -990,12 +992,12 @@ bool ChromeActiveDocument::ParseUrl(const std::wstring& url,
}
bool ChromeActiveDocument::LaunchUrl(const std::wstring& url,
+ const std::string& referrer,
bool is_new_navigation) {
DCHECK(automation_client_.get() != NULL);
url_.Allocate(url.c_str());
- std::string referrer;
std::string utf8_url;
if (!is_new_navigation) {
@@ -1021,11 +1023,6 @@ bool ChromeActiveDocument::LaunchUrl(const std::wstring& url,
// cached and sent with launch settings.
if (url_.Length()) {
WideToUTF8(url_, url_.Length(), &utf8_url);
-
- NavigationManager* mgr = NavigationManager::GetThreadInstance();
- if (mgr)
- referrer = mgr->referrer();
-
if (!automation_client_->InitiateNavigation(utf8_url,
referrer,
is_privileged_)) {