Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8532)

Unified Diff: chrome/renderer/render_view.cc

Issue 8186: Plumb the referrer throughout the OpenURL APIs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/glue_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 3991)
+++ chrome/renderer/render_view.cc (working copy)
@@ -840,6 +840,11 @@
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());
}
@@ -1521,7 +1526,7 @@
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.
}
}
@@ -1558,7 +1563,7 @@
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;
}
@@ -1823,8 +1828,9 @@
}
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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/glue_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698