Commit 0ca92d66 authored by thestig's avatar thestig Committed by Commit bot

PDF: Set a referrer when performing a SaveAs operation.

Currently, the plugin's frame's url is
chrome-extension://[pdf_extension_id]/index-material.html
and that gets sanitized to nothing. Instead, just use the document's
URL, like in r327641.

BUG=563137

Review URL: https://codereview.chromium.org/1510993002

Cr-Commit-Position: refs/heads/master@{#364498}
parent e66da3f2
......@@ -153,11 +153,10 @@ int32_t PepperPDFHost::OnHostMsgSaveAs(
return PP_ERROR_FAILED;
GURL url = instance->GetPluginURL();
content::RenderView* render_view = instance->GetRenderView();
blink::WebLocalFrame* frame =
render_view->GetWebView()->mainFrame()->toWebLocalFrame();
content::Referrer referrer = content::Referrer::SanitizeForRequest(
url, content::Referrer(frame->document().url(),
frame->document().referrerPolicy()));
content::Referrer referrer;
referrer.url = url;
referrer.policy = blink::WebReferrerPolicyDefault;
referrer = content::Referrer::SanitizeForRequest(url, referrer);
render_view->Send(
new PDFHostMsg_PDFSaveURLAs(render_view->GetRoutingID(), url, referrer));
return PP_OK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment