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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2870303002: PDF: React to doc links on mouse up instead of mouse down. (Closed)
Patch Set: Created 3 years, 7 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/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 8ab5a1bb67b2f5d879aeaf7561377195c36ad1c2..22a72c26330ff7d82ca2ce46ba938723fc4b279b 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -1706,19 +1706,13 @@ bool PDFiumEngine::OnMouseDown(const pp::MouseInputEvent& event) {
// Decide whether to open link or not based on user action in mouse up and
// mouse move events.
- if (area == PDFiumPage::WEBLINK_AREA)
+ if (area == PDFiumPage::WEBLINK_AREA || area == PDFiumPage::DOCLINK_AREA)
return true;
// Prevent middle mouse button from selecting texts.
if (event.GetButton() == PP_INPUTEVENT_MOUSEBUTTON_MIDDLE)
return false;
- if (area == PDFiumPage::DOCLINK_AREA) {
- client_->ScrollToPage(target.page);
- client_->FormTextFieldFocusChange(false);
- return true;
- }
-
if (page_index != -1) {
last_page_mouse_down_ = page_index;
double page_x, page_y;
@@ -1816,6 +1810,11 @@ bool PDFiumEngine::OnMouseUp(const pp::MouseInputEvent& event) {
client_->FormTextFieldFocusChange(false);
return true;
}
+ if (area == PDFiumPage::DOCLINK_AREA) {
+ client_->ScrollToPage(target.page);
+ client_->FormTextFieldFocusChange(false);
+ return true;
+ }
}
// Prevent middle mouse button from selecting texts.
« 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