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

Unified Diff: pdf/instance.cc

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
« chrome/browser/resources/pdf/pdf.js ('K') | « chrome/browser/resources/pdf/pdf.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index d700be8757d679f00d98f86329a649308e64bfef..c31d4b2811470c54b0f56aa82a7bf38d0f0c5bb2 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -509,8 +509,12 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) {
pp::KeyboardInputEvent keyboard_event(event);
bool no_h_scrollbar = !h_scrollbar_.get();
uint32_t key_code = keyboard_event.GetKeyCode();
- bool page_down = no_h_scrollbar && key_code == ui::VKEY_RIGHT;
- bool page_up = no_h_scrollbar && key_code == ui::VKEY_LEFT;
+ // Page down is ui::VKEY_NEXT.
+ bool page_down = no_h_scrollbar &&
+ (key_code == ui::VKEY_RIGHT || key_code == ui::VKEY_NEXT);
+ // Page up is ui::VKEY_PRIOR.
+ bool page_up = no_h_scrollbar &&
+ (key_code == ui::VKEY_LEFT || key_code == ui::VKEY_PRIOR);
if (zoom_mode_ == ZOOM_FIT_TO_PAGE) {
bool has_shift =
keyboard_event.GetModifiers() & PP_INPUTEVENT_MODIFIER_SHIFTKEY;
« chrome/browser/resources/pdf/pdf.js ('K') | « chrome/browser/resources/pdf/pdf.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698