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

Unified Diff: pdf/out_of_process_instance.cc

Issue 976123002: Allow middle-click scrolling to work for PDFs and print preview (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index ef83cd99ba2d002695b0ef110025abe0742489a8..4fdd360593230dea88fd077387e48f30c3cb1596 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -550,8 +550,12 @@ bool OutOfProcessInstance::HandleInputEvent(
if (engine_->HandleEvent(offset_event))
return true;
- // TODO(raymes): Implement this scroll behavior in JS:
- // When click+dragging, scroll the document correctly.
+ // Middle click is used for scrolling and is handled by the container page.
+ pp::MouseInputEvent mouse_event(event_device_res);
+ if (!mouse_event.is_null() &&
+ mouse_event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) {
+ return false;
+ }
// Return true for unhandled clicks so the plugin takes focus.
return (event.GetType() == PP_INPUTEVENT_TYPE_MOUSEDOWN);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698