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

Side by Side Diff: chrome/browser/resources/pdf/open_pdf_params_parser.js

Issue 855323002: Refactoring of code by moving navigate_() to separate file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nit. 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/pdf/navigator.js ('k') | chrome/browser/resources/pdf/pdf.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Creates a new OpenPDFParamsParser. This parses the open pdf parameters 8 * Creates a new OpenPDFParamsParser. This parses the open pdf parameters
9 * passed in the url to set initial viewport settings for opening the pdf. 9 * passed in the url to set initial viewport settings for opening the pdf.
10 * @param {string} url to be parsed.
11 */ 10 */
12 function OpenPDFParamsParser(url) { 11 function OpenPDFParamsParser() {
13 // A dictionary of all the named destinations in the PDF. 12 // A dictionary of all the named destinations in the PDF.
14 this.namedDestinations = {}; 13 this.namedDestinations = {};
15 } 14 }
16 15
17 OpenPDFParamsParser.prototype = { 16 OpenPDFParamsParser.prototype = {
18 /** 17 /**
19 * @private 18 * @private
20 * Parse zoom parameter of open PDF parameters. If this 19 * Parse zoom parameter of open PDF parameters. If this
21 * parameter is passed while opening PDF then PDF should be opened 20 * parameter is passed while opening PDF then PDF should be opened
22 * at the specified zoom level. 21 * at the specified zoom level.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (!isNaN(pageNumber) && pageNumber > 0) 90 if (!isNaN(pageNumber) && pageNumber > 0)
92 viewportPosition['page'] = pageNumber - 1; 91 viewportPosition['page'] = pageNumber - 1;
93 } 92 }
94 93
95 if ('zoom' in paramsDictionary) 94 if ('zoom' in paramsDictionary)
96 this.parseZoomParam_(paramsDictionary['zoom'], viewportPosition); 95 this.parseZoomParam_(paramsDictionary['zoom'], viewportPosition);
97 96
98 return viewportPosition; 97 return viewportPosition;
99 } 98 }
100 }; 99 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/pdf/navigator.js ('k') | chrome/browser/resources/pdf/pdf.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698