add some minor fixes
This commit is contained in:
parent
9a7651a93f
commit
8d6ee5aad2
2 changed files with 5 additions and 5 deletions
|
@ -86,10 +86,11 @@ void OnPdfResourceIntercepted(
|
||||||
// The URL passes the original pdf resource url, that will be requested
|
// The URL passes the original pdf resource url, that will be requested
|
||||||
// by the webui page.
|
// by the webui page.
|
||||||
// chrome://pdf-viewer/index.html?src=https://somepage/123.pdf
|
// chrome://pdf-viewer/index.html?src=https://somepage/123.pdf
|
||||||
GURL escaped_url(net::EscapeUrlEncodedData(original_url.spec(), true));
|
|
||||||
content::NavigationController::LoadURLParams params(
|
content::NavigationController::LoadURLParams params(
|
||||||
GURL(base::StringPrintf("%sindex.html?%s=%s", kPdfViewerUIOrigin,
|
GURL(base::StringPrintf("%sindex.html?%s=%s",
|
||||||
kPdfPluginSrc, escaped_url.spec().c_str())));
|
kPdfViewerUIOrigin,
|
||||||
|
kPdfPluginSrc,
|
||||||
|
net::EscapeUrlEncodedData(original_url.spec(), false).c_str())));
|
||||||
web_contents->GetController().LoadURLWithParams(params);
|
web_contents->GetController().LoadURLWithParams(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,10 +55,9 @@ AtomWebUIControllerFactory::CreateWebUIControllerForURL(content::WebUI* web_ui,
|
||||||
std::string stream_id, src;
|
std::string stream_id, src;
|
||||||
|
|
||||||
const net::UnescapeRule::Type unescape_rules =
|
const net::UnescapeRule::Type unescape_rules =
|
||||||
net::UnescapeRule::SPOOFING_AND_CONTROL_CHARS |
|
|
||||||
net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS |
|
net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS |
|
||||||
net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS |
|
net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS |
|
||||||
net::UnescapeRule::NORMAL | net::UnescapeRule::REPLACE_PLUS_WITH_SPACE;
|
net::UnescapeRule::REPLACE_PLUS_WITH_SPACE;
|
||||||
|
|
||||||
for (const auto& param : toplevel_params) {
|
for (const auto& param : toplevel_params) {
|
||||||
if (param.first == kPdfPluginSrc) {
|
if (param.first == kPdfPluginSrc) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue