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..e1c764e26fa4a23c523b3658606898f555559f30 100644 |
--- a/chrome/browser/resources/pdf/open_pdf_params_parser.js |
+++ b/chrome/browser/resources/pdf/open_pdf_params_parser.js |
@@ -11,7 +11,10 @@ |
*/ |
function OpenPDFParamsParser(url) { |
this.url_ = url; |
+ this.namedDest; |
raymes
2015/01/13 01:59:31
I don't think you need to store this as an instanc
Deepak
2015/01/13 08:29:07
agreed
|
this.urlParams = {}; |
+ // This will have name of all the nameddest from the loaded PDF. |
+ this.namedDestinations = {}; |
this.parseOpenPDFParams_(); |
} |
@@ -60,6 +63,11 @@ OpenPDFParamsParser.prototype = { |
return; |
var paramTokens = originalUrl.substring(paramIndex + 1).split('&'); |
+ if ((paramTokens.length == 1) && (paramTokens[0].search('=') == -1)) { |
+ this.namedDest = paramTokens[0]; |
+ return; |
+ } |
+ |
var paramsDictionary = {}; |
for (var i = 0; i < paramTokens.length; ++i) { |
var keyValueSplit = paramTokens[i].split('='); |
@@ -77,5 +85,8 @@ OpenPDFParamsParser.prototype = { |
if ('zoom' in paramsDictionary) |
this.parseZoomParam_(paramsDictionary['zoom']); |
+ |
+ if ('nameddest' in paramsDictionary) |
+ this.namedDest = paramsDictionary['nameddest']; |
} |
}; |