From 9ef93d0f3f417c09d2c24e9cceaf600eeb8ff44a Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Wed, 3 Oct 2018 18:41:03 +0000 Subject: Reland "Make potentially dangerous Actions require a user click." This is a reland of 9d784c291714b703b16185e69860a3797de85b6c https://chromium-review.googlesource.com/c/chromium/src/+/1244367 was submitted changing the test that broke with this CL to not depend on PDF OpenActions anymore. Original change's description: > Make potentially dangerous Actions require a user click. > > URI and SubmitForm actions are only handled if the event was > ButtonUp or ButtonDown. > > Bug: 851821 > Change-Id: If6eb0ff44f6d62ac6df50b552c0bdc582885ab5d > Reviewed-on: https://pdfium-review.googlesource.com/42731 > Commit-Queue: Henrique Nakashima > Reviewed-by: Tom Sepez > Reviewed-by: Ryan Harrison Bug: 851821 Change-Id: Iaf9c399059590f0f1a050ac450e08ee60a8d5a38 Reviewed-on: https://pdfium-review.googlesource.com/43410 Commit-Queue: Henrique Nakashima Reviewed-by: Tom Sepez Reviewed-by: Ryan Harrison --- testing/embedder_test.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'testing/embedder_test.cpp') diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index 215009ceac..43f077ca01 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -241,6 +241,8 @@ FPDF_FORMHANDLE EmbedderTest::SetupFormFillEnvironment( formfillinfo->FFI_SetTimer = SetTimerTrampoline; formfillinfo->FFI_KillTimer = KillTimerTrampoline; formfillinfo->FFI_GetPage = GetPageTrampoline; + formfillinfo->FFI_DoURIAction = DoURIActionTrampoline; + if (javascript_option == JavaScriptOption::kEnableJavaScript) formfillinfo->m_pJsPlatform = platform; @@ -477,6 +479,13 @@ FPDF_PAGE EmbedderTest::GetPageTrampoline(FPDF_FORMFILLINFO* info, page_index); } +// static +void EmbedderTest::DoURIActionTrampoline(FPDF_FORMFILLINFO* info, + FPDF_BYTESTRING uri) { + EmbedderTest* test = static_cast(info); + return test->delegate_->DoURIAction(uri); +} + // static std::string EmbedderTest::HashBitmap(FPDF_BITMAP bitmap) { uint8_t digest[16]; -- cgit v1.2.3