summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_formfillenvironment.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-07-16 20:49:56 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-07-16 20:49:56 +0000
commitc30b4e16885c8fd5f59965f48b61ec033ae4691a (patch)
treed15118e1f461ef5654f94c6d63e8acb96275800f /fpdfsdk/cpdfsdk_formfillenvironment.cpp
parent4cf61e07625888a3b56c4de97719c87cf514fb7f (diff)
downloadpdfium-c30b4e16885c8fd5f59965f48b61ec033ae4691a.tar.xz
Alert embedder when attempting to save XFA form
This CL adds an experimental callback to the form fill API that allows PDFium to signal to the embedder that an attempt call save occurred. The embedder is responsible for showing an appropriate UI when this occurs. When PDF saving is implemented the API can be removed. BUG=pdfium:953 Change-Id: Iba30f4d0547fe773b793e499995be426626092a0 Reviewed-on: https://pdfium-review.googlesource.com/35870 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/cpdfsdk_formfillenvironment.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_formfillenvironment.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index b224fc75d0..649d3bbd2e 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -39,7 +39,8 @@ CPDFSDK_FormFillEnvironment::CPDFSDK_FormFillEnvironment(
m_pCPDFDoc(pDoc),
m_pSysHandler(pdfium::MakeUnique<CFX_SystemHandler>(this)),
m_bChangeMask(false),
- m_bBeingDestroyed(false) {}
+ m_bBeingDestroyed(false),
+ m_SaveCalled(nullptr) {}
CPDFSDK_FormFillEnvironment::~CPDFSDK_FormFillEnvironment() {
m_bBeingDestroyed = true;
@@ -629,6 +630,13 @@ CPDFSDK_InterForm* CPDFSDK_FormFillEnvironment::GetInterForm() {
return m_pInterForm.get();
}
+void CPDFSDK_FormFillEnvironment::SaveCalled() {
+ if (!m_pInfo || !m_SaveCalled)
+ return;
+
+ m_SaveCalled(m_pInfo);
+}
+
void CPDFSDK_FormFillEnvironment::UpdateAllViews(CPDFSDK_PageView* pSender,
CPDFSDK_Annot* pAnnot) {
for (const auto& it : m_PageMap) {