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/cjs_context.h" | 7 #include "fpdfsdk/javascript/cjs_context.h" |
8 | 8 |
9 #include "fpdfsdk/javascript/JS_EventHandler.h" | 9 #include "fpdfsdk/javascript/JS_EventHandler.h" |
10 #include "fpdfsdk/javascript/cjs_runtime.h" | 10 #include "fpdfsdk/javascript/cjs_runtime.h" |
11 #include "fpdfsdk/javascript/resource.h" | 11 #include "fpdfsdk/javascript/resource.h" |
12 | 12 |
13 CJS_Context::CJS_Context(CJS_Runtime* pRuntime) | 13 CJS_Context::CJS_Context(CJS_Runtime* pRuntime) |
14 : m_pRuntime(pRuntime), m_bBusy(FALSE) { | 14 : m_pRuntime(pRuntime), |
15 m_pEventHandler = new CJS_EventHandler(this); | 15 m_pEventHandler(new CJS_EventHandler(this)), |
16 } | 16 m_bBusy(FALSE) {} |
17 | 17 |
18 CJS_Context::~CJS_Context() { | 18 CJS_Context::~CJS_Context() {} |
19 delete m_pEventHandler; | |
20 } | |
21 | 19 |
22 CPDFSDK_Document* CJS_Context::GetReaderDocument() { | 20 CPDFSDK_Document* CJS_Context::GetReaderDocument() { |
23 return m_pRuntime->GetReaderDocument(); | 21 return m_pRuntime->GetReaderDocument(); |
24 } | 22 } |
25 | 23 |
26 CPDFDoc_Environment* CJS_Context::GetReaderApp() { | 24 CPDFDoc_Environment* CJS_Context::GetReaderApp() { |
27 return m_pRuntime->GetReaderApp(); | 25 return m_pRuntime->GetReaderApp(); |
28 } | 26 } |
29 | 27 |
30 FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, | 28 FX_BOOL CJS_Context::RunScript(const CFX_WideString& script, |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 267 } |
270 | 268 |
271 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) { | 269 void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) { |
272 m_pEventHandler->OnBatchExec(pTarget); | 270 m_pEventHandler->OnBatchExec(pTarget); |
273 } | 271 } |
274 | 272 |
275 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget, | 273 void CJS_Context::OnMenu_Exec(CPDFSDK_Document* pTarget, |
276 const CFX_WideString& strTargetName) { | 274 const CFX_WideString& strTargetName) { |
277 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName); | 275 m_pEventHandler->OnMenu_Exec(pTarget, strTargetName); |
278 } | 276 } |
OLD | NEW |