From 854d71c1420eb80ec79755a6cdf829f3f39aead7 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 18 Oct 2017 12:28:14 -0400 Subject: Refactor HasXFAField into HasFormInfo The existing API is too restrictive for collection the metrics information that we want. Specifically it only tells us if there are XFA forms in the document, but not AcroForms. This refactoring makes the method more general, so that non-XFA information is provided also. This change in semantics of the return value required some changes at the call sites of the API. BUG=chromium:775519 Change-Id: Id421c66c09b47196c252c64cdc2c711ca1911de0 Reviewed-on: https://pdfium-review.googlesource.com/16210 Commit-Queue: Ryan Harrison Reviewed-by: Henrique Nakashima Reviewed-by: dsinclair --- fpdfsdk/fpdfxfa/cpdfxfa_context.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_context.h') diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.h b/fpdfsdk/fpdfxfa/cpdfxfa_context.h index 52af64ac86..f5b62f53da 100644 --- a/fpdfsdk/fpdfxfa/cpdfxfa_context.h +++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.h @@ -40,7 +40,11 @@ class CPDFXFA_Context : public IXFA_AppProvider { CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); } CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); } CXFA_FFDocView* GetXFADocView() { return m_pXFADocView.Get(); } - XFA_DocType GetDocType() const { return m_iDocType; } + FormType GetFormType() const { return m_FormType; } + bool ContainsXFAForm() const { + return m_FormType == FormType::kXFAFull || + m_FormType == FormType::kXFAForeground; + } v8::Isolate* GetJSERuntime() const; CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); } @@ -101,7 +105,7 @@ class CPDFXFA_Context : public IXFA_AppProvider { private: void CloseXFADoc(); - XFA_DocType m_iDocType; + FormType m_FormType; std::unique_ptr m_pPDFDoc; std::unique_ptr m_pXFADoc; Observable::ObservedPtr m_pFormFillEnv; -- cgit v1.2.3