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

Unified Diff: chrome/browser/resources/pdf/open_pdf_params_parser.js

Issue 830433002: Navigation to relative fragments does not work correctly for OOP pdf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes after taking all nameddest at load time. Created 5 years, 11 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 | « no previous file | chrome/browser/resources/pdf/pdf.js » ('j') | chrome/browser/resources/pdf/pdf.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/open_pdf_params_parser.js
diff --git a/chrome/browser/resources/pdf/open_pdf_params_parser.js b/chrome/browser/resources/pdf/open_pdf_params_parser.js
index f4fe8e7354a1617a6c5929c23e72379af59b9465..b01adea31b69bd87c6617e538a2a163e080ae468 100644
--- a/chrome/browser/resources/pdf/open_pdf_params_parser.js
+++ b/chrome/browser/resources/pdf/open_pdf_params_parser.js
@@ -60,6 +60,13 @@ OpenPDFParamsParser.prototype = {
return;
var paramTokens = originalUrl.substring(paramIndex + 1).split('&');
+ // Handle the case of http://foo.com/bar#NAMEDDEST. This is not explicitly
+ // mentioned except by example in the Adobe "PDF Open Parameters" document.
raymes 2015/01/13 01:59:31 How come you removed this?
+ if ((paramTokens.length == 1) && (paramTokens[0].search('=') == -1)) {
+ this.urlParams['nameddest'] = paramTokens[0];
raymes 2015/01/11 23:08:41 We don't actually want to store nameddest in urlPa
Deepak 2015/01/12 09:21:43 Done.
raymes 2015/01/13 01:59:31 Please take a look at the comment above again, in
+ return;
+ }
+
var paramsDictionary = {};
for (var i = 0; i < paramTokens.length; ++i) {
var keyValueSplit = paramTokens[i].split('=');
@@ -78,4 +85,7 @@ OpenPDFParamsParser.prototype = {
if ('zoom' in paramsDictionary)
this.parseZoomParam_(paramsDictionary['zoom']);
}
+
+ if ('nameddest' in paramsDictionary)
+ this.urlParams['nameddest'] = paramsDictionary['nameddest'];
};
« no previous file with comments | « no previous file | chrome/browser/resources/pdf/pdf.js » ('j') | chrome/browser/resources/pdf/pdf.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698