Commit 06f223dc authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

PDF: Update mouse cursor for middle button events.

When panning, rather than only waiting for a mouse move event before
switching to the hand cursor, check for middle mouse up/down events in
non-link areas and switch from/to the hand cursor immediately.

BUG=234933

Change-Id: I29661a7f60ccafdc710c639ab1206a566705272e
Reviewed-on: https://chromium-review.googlesource.com/996384Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548285}
parent ba98a5ac
......@@ -1973,6 +1973,9 @@ bool PDFiumEngine::OnMiddleMouseDown(const pp::MouseInputEvent& event) {
if (IsLinkArea(area))
return true;
// Switch to hand cursor when panning.
client_->UpdateCursor(PP_CURSORTYPE_HAND);
// Prevent middle mouse button from selecting texts.
return false;
}
......@@ -2098,9 +2101,12 @@ bool PDFiumEngine::OnMouseUp(const pp::MouseInputEvent& event) {
}
}
if (event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) {
// Update the cursor when panning stops.
client_->UpdateCursor(DetermineCursorType(area, form_type));
// Prevent middle mouse button from selecting texts.
if (event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE)
return false;
}
if (page_index != -1) {
double page_x;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment