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

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

Issue 573523002: PDF Viewer - PageUp/Down don't move pdf by page size in FitToPage mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | pdf/instance.cc » ('j') | pdf/instance.cc » ('J')
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 0aa437aef03c7e1747929fe50925367d29164878..9676ae49c294a18f76fc0600a1419523be6c748a 100644
--- a/chrome/browser/resources/pdf/pdf.js
+++ b/chrome/browser/resources/pdf/pdf.js
@@ -169,13 +169,14 @@ PDFViewer.prototype = {
*/
handleKeyEvent_: function(e) {
var position = this.viewport_.position;
+ var viewport = this.viewport_;
raymes 2014/09/15 00:12:14 nit: remove this line and just add ".bind(this) be
Nikhil 2014/09/16 10:23:29 Done.
// Certain scroll events may be sent from outside of the extension.
var fromScriptingAPI = e.type == 'scriptingKeypress';
var pageUpHandler = function() {
// Go to the previous page if we are fit-to-page.
- if (this.viewport_.fittingType == Viewport.FittingType.FIT_TO_PAGE) {
- this.viewport_.goToPage(this.viewport_.getMostVisiblePage() - 1);
+ if (viewport.fittingType == Viewport.FittingType.FIT_TO_PAGE) {
+ viewport.goToPage(viewport.getMostVisiblePage() - 1);
// Since we do the movement of the page.
e.preventDefault();
} else if (fromScriptingAPI) {
@@ -185,8 +186,8 @@ PDFViewer.prototype = {
};
raymes 2014/09/15 00:12:14 }.bind(this);
Nikhil 2014/09/16 10:23:29 Done.
var pageDownHandler = function() {
// Go to the next page if we are fit-to-page.
- if (this.viewport_.fittingType == Viewport.FittingType.FIT_TO_PAGE) {
- this.viewport_.goToPage(this.viewport_.getMostVisiblePage() + 1);
+ if (viewport.fittingType == Viewport.FittingType.FIT_TO_PAGE) {
+ viewport.goToPage(viewport.getMostVisiblePage() + 1);
// Since we do the movement of the page.
e.preventDefault();
} else if (fromScriptingAPI) {
« no previous file with comments | « no previous file | pdf/instance.cc » ('j') | pdf/instance.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698