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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2166193002: Handle ctrl + shift + left click on links in PDF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle ctrl + shift + left click on links in PDF. Created 4 years, 5 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 | « pdf/pdf_engine.h ('k') | pdf/preview_mode_client.h » ('j') | 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 d0796a5e4eca0a9a2515f452110d92f5ecea0aad..b197e5de42f09e9d4a605c40bd4f788f3ae288bf 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -1643,9 +1643,19 @@ 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) ||
- !!(event.GetModifiers() & PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN);
- client_->NavigateTo(target.url, open_in_new_tab);
+ uint32_t modifiers = event.GetModifiers();
+ bool middle_button =
+ !!(modifiers & PP_INPUTEVENT_MODIFIER_MIDDLEBUTTONDOWN);
+ bool alt_key = !!(modifiers & PP_INPUTEVENT_MODIFIER_ALTKEY);
+ bool ctrl_key = !!(modifiers & PP_INPUTEVENT_MODIFIER_CONTROLKEY);
+ bool meta_key = !!(modifiers & PP_INPUTEVENT_MODIFIER_METAKEY);
+ bool shift_key = !!(modifiers & PP_INPUTEVENT_MODIFIER_SHIFTKEY);
+
+ WindowOpenDisposition disposition =
+ ui::DispositionFromClick(middle_button, alt_key, ctrl_key, meta_key,
+ shift_key);
+
+ client_->NavigateTo(target.url, disposition);
client_->FormTextFieldFocusChange(false);
return true;
}
@@ -3524,7 +3534,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), CURRENT_TAB);
}
void PDFiumEngine::Form_DoGoToAction(FPDF_FORMFILLINFO* param,
« no previous file with comments | « pdf/pdf_engine.h ('k') | pdf/preview_mode_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698