diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 23:01:50 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-27 23:01:50 +0000 |
commit | c058805b99cce98cbc352c499f3e69fd355a84c2 (patch) | |
tree | 93fb4ffdf5daf4d8ae0e3291919a074a8b9e58a7 /chrome/renderer | |
parent | f07cc2ebf950cb22c5c386f95a1be0292de4db3b (diff) | |
download | chromium_src-c058805b99cce98cbc352c499f3e69fd355a84c2.zip chromium_src-c058805b99cce98cbc352c499f3e69fd355a84c2.tar.gz chromium_src-c058805b99cce98cbc352c499f3e69fd355a84c2.tar.bz2 |
Plumb the referrer throughout the OpenURL APIs.
http://code.google.com/p/chromium/issues/detail?id=3224
Caveats:
* Did not update TabNavigation yet. Hence session restore will continue to load the tabs with empty referrer.
* Did not plumb referrer into incognito url open. (Not sure what the right thing to do is here with respect to privacy vs compatibility.)
* Did not plumb referrer throughout the automation controller. No functional impact here, but it makes the code inconsistent with the non-automation version.
Review URL: http://codereview.chromium.org/8186
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4036 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_view.cc | 12 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 734514b..67f816c 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -842,6 +842,11 @@ void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) { if (!is_reload) request->SetHistoryState(params.state); + if (!params.referrer.is_empty()) { + request->SetHttpHeaderValue(L"Referer", + UTF8ToWide(params.referrer.spec())); + } + main_frame->LoadRequest(request.get()); } @@ -1523,7 +1528,7 @@ WindowOpenDisposition RenderView::DispositionForNavigationAction( if (enable_dom_ui_bindings_ || frame->GetInViewSourceMode() || url.SchemeIs("view-source")) { - OpenURL(webview, url, disposition); + OpenURL(webview, url, GURL(), disposition); return IGNORE_ACTION; // Suppress the load here. } } @@ -1560,7 +1565,7 @@ WindowOpenDisposition RenderView::DispositionForNavigationAction( type == WebNavigationTypeOther; if (is_fork) { // Open the URL via the browser, not via WebKit. - OpenURL(webview, url, disposition); + OpenURL(webview, url, GURL(), disposition); return IGNORE_ACTION; } @@ -1825,8 +1830,9 @@ void RenderView::OnMissingPluginStatus(WebPluginDelegate* delegate, } void RenderView::OpenURL(WebView* webview, const GURL& url, + const GURL& referrer, WindowOpenDisposition disposition) { - Send(new ViewHostMsg_OpenURL(routing_id_, url, disposition)); + Send(new ViewHostMsg_OpenURL(routing_id_, url, referrer, disposition)); } // We are supposed to get a single call to Show for a newly created RenderView diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 9c50dfe..ddfe6d3 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -206,6 +206,7 @@ class RenderView : public RenderWidget, public WebViewDelegate, std::string* actual_mime_type); virtual void OnMissingPluginStatus(WebPluginDelegate* delegate, int status); virtual void OpenURL(WebView* webview, const GURL& url, + const GURL& referrer, WindowOpenDisposition disposition); virtual void DidDownloadImage(int id, const GURL& image_url, |