diff options
author | raymes <raymes@chromium.org> | 2015-03-05 15:53:49 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-05 23:54:16 +0000 |
commit | 78a82c836b6025a7d78753237a1b269927c90c9d (patch) | |
tree | 8d6e908aa32d3a0cfb87d2864ea0133e809a4314 /pdf/out_of_process_instance.cc | |
parent | 604a272121087b33a890175286cbaafab6b433f1 (diff) | |
download | chromium_src-78a82c836b6025a7d78753237a1b269927c90c9d.zip chromium_src-78a82c836b6025a7d78753237a1b269927c90c9d.tar.gz chromium_src-78a82c836b6025a7d78753237a1b269927c90c9d.tar.bz2 |
Allow middle-click scrolling to work for PDFs and print preview
This tells the plugin not to handle middle-click events so that they are
properly handled by the container page and allows middle-click scrolling
to work.
BUG=463399
Review URL: https://codereview.chromium.org/976123002
Cr-Commit-Position: refs/heads/master@{#319366}
Diffstat (limited to 'pdf/out_of_process_instance.cc')
-rw-r--r-- | pdf/out_of_process_instance.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc index ee4cd9f..f40582d 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); |