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

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

Issue 2886943006: PDF Plugin: Add compile targets for a few files. (Closed)
Patch Set: Fix test error cause. Created 3 years, 7 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
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 {Object} getNamedDestinationsFunction The function called to fetch 10 * @param {!Function} getNamedDestinationsFunction The function called to fetch
11 * the page number for a named destination. 11 * the page number for a named destination.
12 * @constructor 12 * @constructor
13 */ 13 */
14 function OpenPDFParamsParser(getNamedDestinationsFunction) { 14 function OpenPDFParamsParser(getNamedDestinationsFunction) {
15 this.outstandingRequests_ = []; 15 this.outstandingRequests_ = [];
16 this.getNamedDestinationsFunction_ = getNamedDestinationsFunction; 16 this.getNamedDestinationsFunction_ = getNamedDestinationsFunction;
17 } 17 }
18 18
19 OpenPDFParamsParser.prototype = { 19 OpenPDFParamsParser.prototype = {
20 /** 20 /**
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 * @param {number} pageNumber The page corresponding to the named destination 139 * @param {number} pageNumber The page corresponding to the named destination
140 * requested. 140 * requested.
141 */ 141 */
142 onNamedDestinationReceived: function(pageNumber) { 142 onNamedDestinationReceived: function(pageNumber) {
143 var outstandingRequest = this.outstandingRequests_.shift(); 143 var outstandingRequest = this.outstandingRequests_.shift();
144 if (pageNumber != -1) 144 if (pageNumber != -1)
145 outstandingRequest.viewportPosition.page = pageNumber; 145 outstandingRequest.viewportPosition.page = pageNumber;
146 outstandingRequest.callback(outstandingRequest.viewportPosition); 146 outstandingRequest.callback(outstandingRequest.viewportPosition);
147 }, 147 },
148 }; 148 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698