summaryrefslogtreecommitdiffstats
path: root/pdf/out_of_process_instance.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 23:15:34 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 23:15:34 +0000
commite31b5e93d2e1d93bd5508fc01117caefe7d2f135 (patch)
treeada92415a0defc0891ec53ad7a7249465213efef /pdf/out_of_process_instance.cc
parent48359e235f17bb3d9ad3d8b952c266ffdb70de4f (diff)
downloadchromium_src-e31b5e93d2e1d93bd5508fc01117caefe7d2f135.zip
chromium_src-e31b5e93d2e1d93bd5508fc01117caefe7d2f135.tar.gz
chromium_src-e31b5e93d2e1d93bd5508fc01117caefe7d2f135.tar.bz2
PDF: Fix navigation for links that are just relative fragments.
BUG=389333 TEST=Manual, see bug. Review URL: https://codereview.chromium.org/335993006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf/out_of_process_instance.cc')
-rw-r--r--pdf/out_of_process_instance.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 6f728b7..bd3b70f 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -825,6 +825,11 @@ void OutOfProcessInstance::NavigateTo(const std::string& url,
// Skip the code below so an empty URL does not turn into "http://", which
// will cause GURL to fail a DCHECK.
if (!url_copy.empty()) {
+ // If |url_copy| starts with '#', then it's for the same URL with a
+ // different URL fragment.
+ if (url_copy[0] == '#') {
+ url_copy = url_ + url_copy;
+ }
// If there's no scheme, add http.
if (url_copy.find("://") == std::string::npos &&
url_copy.find("mailto:") == std::string::npos) {
@@ -834,6 +839,7 @@ void OutOfProcessInstance::NavigateTo(const std::string& url,
if (url_copy.find("http://") != 0 &&
url_copy.find("https://") != 0 &&
url_copy.find("ftp://") != 0 &&
+ url_copy.find("file://") != 0 &&
url_copy.find("mailto:") != 0) {
return;
}
@@ -841,6 +847,7 @@ void OutOfProcessInstance::NavigateTo(const std::string& url,
if (url_copy == "http://" ||
url_copy == "https://" ||
url_copy == "ftp://" ||
+ url_copy == "file://" ||
url_copy == "mailto:") {
return;
}