Chromium Code Reviews| Index: pdf/pdfium/pdfium_engine.cc |
| diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc |
| index d0796a5e4eca0a9a2515f452110d92f5ecea0aad..5ca61a2850bbf8818951928c97c5ba39c37bdeba 100644 |
| --- a/pdf/pdfium/pdfium_engine.cc |
| +++ b/pdf/pdfium/pdfium_engine.cc |
| @@ -1643,9 +1643,25 @@ 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) || |
| + NavigateOption option = OPEN_IN_CURRENT_TAB; |
|
Lei Zhang
2016/07/21 05:34:28
No need to initialize since all the cases are cove
jaepark
2016/07/21 22:34:33
Done.
|
| + bool ctrl = !!(event.GetModifiers() & kDefaultKeyModifier) || |
|
Lei Zhang
2016/07/21 05:34:28
Maybe control can stay as open_in_new_tab?
jaepark
2016/07/21 22:34:33
Done.
|
| !!(event.GetModifiers() & PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN); |
| - client_->NavigateTo(target.url, open_in_new_tab); |
| + |
| + bool shift = !!(event.GetModifiers() & PP_INPUTEVENT_MODIFIER_SHIFTKEY); |
| + |
| + if (ctrl) { |
| + if (shift) |
| + option = OPEN_IN_NEW_FOREGROUND_TAB; |
| + else |
| + option = OPEN_IN_NEW_BACKGROUND_TAB; |
| + } else { |
| + if (shift) |
| + option = OPEN_IN_NEW_WINDOW; |
| + else |
| + option = OPEN_IN_CURRENT_TAB; |
| + } |
| + |
| + client_->NavigateTo(target.url, option); |
| client_->FormTextFieldFocusChange(false); |
| return true; |
| } |
| @@ -3524,7 +3540,7 @@ void PDFiumEngine::Form_SetTextFieldFocus(FPDF_FORMFILLINFO* param, |
| void PDFiumEngine::Form_DoURIAction(FPDF_FORMFILLINFO* param, |
| FPDF_BYTESTRING uri) { |
| PDFiumEngine* engine = static_cast<PDFiumEngine*>(param); |
| - engine->client_->NavigateTo(std::string(uri), false); |
| + engine->client_->NavigateTo(std::string(uri), OPEN_IN_CURRENT_TAB); |
| } |
| void PDFiumEngine::Form_DoGoToAction(FPDF_FORMFILLINFO* param, |