| Index: pdf/pdfium/pdfium_engine.cc
|
| diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
|
| index 05f73098ec7870b45d04f26cc6b176a2e21fb2f8..ef9aeef229a39da3b96f4fb1dc36fc885bfa742f 100644
|
| --- a/pdf/pdfium/pdfium_engine.cc
|
| +++ b/pdf/pdfium/pdfium_engine.cc
|
| @@ -1527,8 +1527,10 @@ bool PDFiumEngine::OnMouseDown(const pp::MouseInputEvent& event) {
|
| selection_.clear();
|
| return true;
|
| }
|
| - if (event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_LEFT)
|
| + if (event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_LEFT &&
|
| + event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) {
|
| return false;
|
| + }
|
|
|
| SelectionChangeInvalidator selection_invalidator(this);
|
| selection_.clear();
|
| @@ -1620,8 +1622,10 @@ void PDFiumEngine::OnMultipleClick(int click_count,
|
| }
|
|
|
| bool PDFiumEngine::OnMouseUp(const pp::MouseInputEvent& event) {
|
| - if (event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_LEFT)
|
| + if (event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_LEFT &&
|
| + event.GetButton() != PP_INPUTEVENT_MOUSEBUTTON_MIDDLE) {
|
| return false;
|
| + }
|
|
|
| int page_index = -1;
|
| int char_index = -1;
|
| @@ -1633,7 +1637,8 @@ bool PDFiumEngine::OnMouseUp(const pp::MouseInputEvent& event) {
|
| // Open link on mouse up for same link for which mouse down happened earlier.
|
| if (mouse_down_state_.Matches(area, target)) {
|
| if (area == PDFiumPage::WEBLINK_AREA) {
|
| - bool open_in_new_tab = !!(event.GetModifiers() & kDefaultKeyModifier);
|
| + bool open_in_new_tab = !!(event.GetModifiers() & kDefaultKeyModifier) ||
|
| + !!(event.GetModifiers() & PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN);
|
| client_->NavigateTo(target.url, open_in_new_tab);
|
| client_->FormTextFieldFocusChange(false);
|
| return true;
|
| @@ -3667,6 +3672,15 @@ FPDF_BOOL PDFiumEngine::Pause_NeedToPauseNow(IFSDK_PAUSE* param) {
|
| InMilliseconds() > engine->progressive_paint_timeout_;
|
| }
|
|
|
| +std::vector<pp::Rect> PDFiumEngine::GetLinkRects() {
|
| + int page_index = GetMostVisiblePage();
|
| +
|
| + if (page_index < 0)
|
| + return std::vector<pp::Rect>();
|
| +
|
| + return pages_[page_index]->GetLinkRects();
|
| +}
|
| +
|
| ScopedUnsupportedFeature::ScopedUnsupportedFeature(PDFiumEngine* engine)
|
| : engine_(engine), old_engine_(g_engine_for_unsupported) {
|
| g_engine_for_unsupported = engine_;
|
|
|