summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome_frame/chrome_active_document.cc13
-rw-r--r--chrome_frame/chrome_active_document.h3
2 files changed, 7 insertions, 9 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_)) {
diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h
index 977ed90..1360ff1 100644
--- a/chrome_frame/chrome_active_document.h
+++ b/chrome_frame/chrome_active_document.h
@@ -391,7 +391,8 @@ END_EXEC_COMMAND_MAP()
// Initiates navigation to the URL passed in.
// Returns true on success.
- bool LaunchUrl(const std::wstring& url, bool is_new_navigation);
+ bool LaunchUrl(const std::wstring& url, const std::string& referrer,
+ bool is_new_navigation);
// Handler to set the page font size in Chrome.
HRESULT SetPageFontSize(const GUID* cmd_group_guid,