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

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

Issue 492433003: PDF: Do more robust page number parsing in OOP plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/viewport.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/pdf.js
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js
index 70f53b7afc0068642049aacaeae66f4aae1c5929..c5920f877dc10c80a416c95c23b8fb7ab4ebc105 100644
--- a/chrome/browser/resources/pdf/pdf.js
+++ b/chrome/browser/resources/pdf/pdf.js
@@ -287,8 +287,10 @@ PDFViewer.prototype = {
// Order is important as later actions can override the effects
// of previous actions.
if ('page' in paramsDictionary) {
- // value is 1-based.
- this.viewport_.goToPage(paramsDictionary['page'] - 1);
+ // |pageNumber| is 1-based, but goToPage() take a zero-based page number.
+ var pageNumber = parseInt(paramsDictionary['page']);
+ if (!isNaN(pageNumber))
+ this.viewport_.goToPage(pageNumber - 1);
raymes 2014/08/20 00:53:54 What happens without this?
Lei Zhang 2014/08/20 00:57:19 Without this CL, in goToPage(), we blow past the p
}
},
« no previous file with comments | « no previous file | chrome/browser/resources/pdf/viewport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698