Move CPDFSDK_FormFillEnvironment::Is{SHIFT,CTRL,ALT}KeyDown to CPWL_Wnd
Removes an include of top-level fpdfsdk/ in fpdfsdk/pwl at the expense
of having another public/fwl_event.h include in cpwl_wnd.h (there are
several pre-existing instances of this public file used in pwl/).
In turn, fix some IWYU exposed by the change.
Change-Id: I1bc299f565aed4b4494bc4b969e5ad27aeb6263b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/58613
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
index b1a31fe..f4807b6 100644
--- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp
+++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
@@ -19,6 +19,7 @@
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/cpdfsdk_widget.h"
#include "fpdfsdk/cpdfsdk_widgethandler.h"
+#include "fpdfsdk/pwl/cpwl_wnd.h"
#include "public/fpdf_fwlevent.h"
#include "third_party/base/ptr_util.h"
@@ -225,16 +226,15 @@
bool CPDFSDK_AnnotHandlerMgr::Annot_OnKeyDown(CPDFSDK_Annot* pAnnot,
int nKeyCode,
int nFlag) {
- if (CPDFSDK_FormFillEnvironment::IsCTRLKeyDown(nFlag) ||
- CPDFSDK_FormFillEnvironment::IsALTKeyDown(nFlag)) {
+ if (CPWL_Wnd::IsCTRLKeyDown(nFlag) || CPWL_Wnd::IsALTKeyDown(nFlag)) {
return GetAnnotHandler(pAnnot)->OnKeyDown(pAnnot, nKeyCode, nFlag);
}
ObservedPtr<CPDFSDK_Annot> pObservedAnnot(pAnnot);
CPDFSDK_PageView* pPage = pAnnot->GetPageView();
CPDFSDK_Annot* pFocusAnnot = pPage->GetFocusAnnot();
if (pFocusAnnot && (nKeyCode == FWL_VKEY_Tab)) {
- ObservedPtr<CPDFSDK_Annot> pNext(GetNextAnnot(
- pFocusAnnot, !CPDFSDK_FormFillEnvironment::IsSHIFTKeyDown(nFlag)));
+ ObservedPtr<CPDFSDK_Annot> pNext(
+ GetNextAnnot(pFocusAnnot, !CPWL_Wnd::IsSHIFTKeyDown(nFlag)));
if (pNext && pNext.Get() != pFocusAnnot) {
pPage->GetFormFillEnv()->SetFocusAnnot(&pNext);
return true;