Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: fpdfsdk/javascript/JS_Object.cpp

Issue 2167343002: Remove EnableMessageBox() / IsMessageBoxEnabled() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/javascript/JS_Runtime_Stub.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/JS_Object.cpp
diff --git a/fpdfsdk/javascript/JS_Object.cpp b/fpdfsdk/javascript/JS_Object.cpp
index 8a4dc0fa33c98223ffb4da535289865665230490..b0a307beb11a368849c6fcdfeca548fc38ec9ea3 100644
--- a/fpdfsdk/javascript/JS_Object.cpp
+++ b/fpdfsdk/javascript/JS_Object.cpp
@@ -10,24 +10,6 @@
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/cjs_context.h"
-namespace {
-
-int FXJS_MsgBox(CPDFDoc_Environment* pApp,
- const FX_WCHAR* swMsg,
- const FX_WCHAR* swTitle,
- FX_UINT nType,
- FX_UINT nIcon) {
- if (!pApp)
- return 0;
-
- if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
- pDoc->KillFocusAnnot();
-
- return pApp->JS_appAlert(swMsg, swTitle, nType, nIcon);
-}
-
-} // namespace
-
CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {}
CJS_EmbedObj::~CJS_EmbedObj() {
@@ -39,7 +21,13 @@ int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp,
const FX_WCHAR* swTitle,
FX_UINT nType,
FX_UINT nIcon) {
- return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon);
+ if (!pApp)
+ return 0;
+
+ if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
+ pDoc->KillFocusAnnot();
+
+ return pApp->JS_appAlert(swMsg, swTitle, nType, nIcon);
}
void CJS_EmbedObj::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) {
@@ -80,11 +68,9 @@ void CJS_Object::InitInstance(IJS_Runtime* pIRuntime) {}
void CJS_Object::ExitInstance() {}
void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) {
- if (pContext->IsMsgBoxEnabled()) {
- CPDFDoc_Environment* pApp = pContext->GetReaderApp();
- if (pApp)
- pApp->JS_appAlert(swMsg, nullptr, 0, 3);
- }
+ CPDFDoc_Environment* pApp = pContext->GetReaderApp();
+ if (pApp)
+ pApp->JS_appAlert(swMsg, nullptr, 0, 3);
}
CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj,
« no previous file with comments | « no previous file | fpdfsdk/javascript/JS_Runtime_Stub.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698