diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-07-16 20:49:56 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-16 20:49:56 +0000 |
commit | c30b4e16885c8fd5f59965f48b61ec033ae4691a (patch) | |
tree | d15118e1f461ef5654f94c6d63e8acb96275800f /fxjs/cjs_app.cpp | |
parent | 4cf61e07625888a3b56c4de97719c87cf514fb7f (diff) | |
download | pdfium-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 'fxjs/cjs_app.cpp')
-rw-r--r-- | fxjs/cjs_app.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fxjs/cjs_app.cpp b/fxjs/cjs_app.cpp index ad155b787c..fd98670c51 100644 --- a/fxjs/cjs_app.cpp +++ b/fxjs/cjs_app.cpp @@ -404,6 +404,12 @@ void CJS_App::ClearTimerCommon(CJS_Runtime* pRuntime, CJS_Return CJS_App::execMenuItem( CJS_Runtime* pRuntime, const std::vector<v8::Local<v8::Value>>& params) { + if (params.size() > 0 && IsTypeKnown(params[0])) { + WideString item = pRuntime->ToWideString(params[0]); + if (item == L"SaveAs" && pRuntime->GetFormFillEnv()) + pRuntime->GetFormFillEnv()->SaveCalled(); + } + return CJS_Return(JSMessage::kNotSupportedError); } |