From 97f4483de007c2ff248696f24d34634e0adbf894 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Mon, 24 Sep 2018 17:23:27 +0000 Subject: Revert "Make potentially dangerous Actions require a user click." This reverts commit 9d784c291714b703b16185e69860a3797de85b6c. Reason for revert: Roll into chromium is stuck, this is a potential culprit. 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 TBR=tsepez@chromium.org,hnakashima@chromium.org,rharrison@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 851821 Change-Id: I6f1bc0a02f65a24fbd49d53526b985f8a4ea0b4f Reviewed-on: https://pdfium-review.googlesource.com/42990 Reviewed-by: Henrique Nakashima Commit-Queue: Henrique Nakashima --- core/fpdfdoc/cpdf_aaction.cpp | 16 ++-------------- core/fpdfdoc/cpdf_aaction.h | 3 --- 2 files changed, 2 insertions(+), 17 deletions(-) (limited to 'core') diff --git a/core/fpdfdoc/cpdf_aaction.cpp b/core/fpdfdoc/cpdf_aaction.cpp index 8d954697b4..9a95340114 100644 --- a/core/fpdfdoc/cpdf_aaction.cpp +++ b/core/fpdfdoc/cpdf_aaction.cpp @@ -32,9 +32,8 @@ constexpr const char* g_sAATypes[] = { "DP", // DocumentPrinted }; -// |g_sAATypes| should have one less element than enum AActionType due to -// DocumentOpen, which is an artificial type. -static_assert(FX_ArraySize(g_sAATypes) == CPDF_AAction::NumberOfActions - 1, +// |g_sAATypes| should have as many elements as enum AActionType. +static_assert(FX_ArraySize(g_sAATypes) == CPDF_AAction::NumberOfActions, "g_sAATypes count mismatch"); } // namespace @@ -53,14 +52,3 @@ CPDF_Action CPDF_AAction::GetAction(AActionType eType) const { return CPDF_Action(m_pDict ? m_pDict->GetDictFor(g_sAATypes[eType]) : nullptr); } - -// static -bool CPDF_AAction::IsUserClick(AActionType eType) { - switch (eType) { - case ButtonUp: - case ButtonDown: - return true; - default: - return false; - } -} diff --git a/core/fpdfdoc/cpdf_aaction.h b/core/fpdfdoc/cpdf_aaction.h index 90049f5ac4..11eca01f8f 100644 --- a/core/fpdfdoc/cpdf_aaction.h +++ b/core/fpdfdoc/cpdf_aaction.h @@ -35,7 +35,6 @@ class CPDF_AAction { DocumentSaved, PrintDocument, DocumentPrinted, - DocumentOpen, NumberOfActions // Must be last. }; @@ -47,8 +46,6 @@ class CPDF_AAction { CPDF_Action GetAction(AActionType eType) const; const CPDF_Dictionary* GetDict() const { return m_pDict.Get(); } - static bool IsUserClick(AActionType eType); - private: UnownedPtr const m_pDict; }; -- cgit v1.2.3