OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "fpdfsdk/javascript/JS_Object.h" | 7 #include "fpdfsdk/javascript/JS_Object.h" |
8 | 8 |
9 #include "fpdfsdk/include/fsdk_mgr.h" | 9 #include "fpdfsdk/include/fsdk_mgr.h" |
10 #include "fpdfsdk/javascript/JS_Define.h" | 10 #include "fpdfsdk/javascript/JS_Define.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 pDoc->KillFocusAnnot(); | 24 pDoc->KillFocusAnnot(); |
25 | 25 |
26 return pApp->JS_appAlert(swMsg, swTitle, nType, nIcon); | 26 return pApp->JS_appAlert(swMsg, swTitle, nType, nIcon); |
27 } | 27 } |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {} | 31 CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) {} |
32 | 32 |
33 CJS_EmbedObj::~CJS_EmbedObj() { | 33 CJS_EmbedObj::~CJS_EmbedObj() { |
34 m_pJSObject = NULL; | 34 m_pJSObject = nullptr; |
35 } | 35 } |
36 | 36 |
37 int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, | 37 int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, |
38 const FX_WCHAR* swMsg, | 38 const FX_WCHAR* swMsg, |
39 const FX_WCHAR* swTitle, | 39 const FX_WCHAR* swTitle, |
40 FX_UINT nType, | 40 FX_UINT nType, |
41 FX_UINT nIcon) { | 41 FX_UINT nIcon) { |
42 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); | 42 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); |
43 } | 43 } |
44 | 44 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 const FX_WCHAR* swTitle, | 80 const FX_WCHAR* swTitle, |
81 FX_UINT nType, | 81 FX_UINT nType, |
82 FX_UINT nIcon) { | 82 FX_UINT nIcon) { |
83 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); | 83 return FXJS_MsgBox(pApp, swMsg, swTitle, nType, nIcon); |
84 } | 84 } |
85 | 85 |
86 void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) { | 86 void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) { |
87 if (pContext->IsMsgBoxEnabled()) { | 87 if (pContext->IsMsgBoxEnabled()) { |
88 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); | 88 CPDFDoc_Environment* pApp = pContext->GetReaderApp(); |
89 if (pApp) | 89 if (pApp) |
90 pApp->JS_appAlert(swMsg, NULL, 0, 3); | 90 pApp->JS_appAlert(swMsg, nullptr, 0, 3); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj, | 94 CJS_Timer::CJS_Timer(CJS_EmbedObj* pObj, |
95 CPDFDoc_Environment* pApp, | 95 CPDFDoc_Environment* pApp, |
96 CJS_Runtime* pRuntime, | 96 CJS_Runtime* pRuntime, |
97 int nType, | 97 int nType, |
98 const CFX_WideString& script, | 98 const CFX_WideString& script, |
99 uint32_t dwElapse, | 99 uint32_t dwElapse, |
100 uint32_t dwTimeOut) | 100 uint32_t dwTimeOut) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // static | 148 // static |
149 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { | 149 CJS_Timer::TimerMap* CJS_Timer::GetGlobalTimerMap() { |
150 // Leak the timer array at shutdown. | 150 // Leak the timer array at shutdown. |
151 static auto* s_TimerMap = new TimerMap; | 151 static auto* s_TimerMap = new TimerMap; |
152 return s_TimerMap; | 152 return s_TimerMap; |
153 } | 153 } |
154 | 154 |
155 void CJS_Timer::OnDestroyed() { | 155 void CJS_Timer::OnDestroyed() { |
156 m_bValid = false; | 156 m_bValid = false; |
157 } | 157 } |
OLD | NEW |