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 "../../public/fpdf_ext.h" | 7 #include "../../public/fpdf_ext.h" |
8 #include "../../third_party/base/nonstd_unique_ptr.h" | 8 #include "../../third_party/base/nonstd_unique_ptr.h" |
9 #include "../include/fsdk_define.h" | 9 #include "../include/fsdk_define.h" |
10 #include "../include/fsdk_mgr.h" | 10 #include "../include/fsdk_mgr.h" |
11 #include "../include/formfiller/FFL_FormFiller.h" | 11 #include "../include/formfiller/FFL_FormFiller.h" |
12 #include "../include/javascript/IJavaScript.h" | 12 #include "../include/javascript/IJavaScript.h" |
13 #include "../include/javascript/JS_Runtime.h" | |
14 | 13 |
15 #if _FX_OS_ == _FX_ANDROID_ | 14 #if _FX_OS_ == _FX_ANDROID_ |
16 #include "time.h" | 15 #include "time.h" |
17 #else | 16 #else |
18 #include <ctime> | 17 #include <ctime> |
19 #endif | 18 #endif |
20 | 19 |
21 class CFX_SystemHandler : public IFX_SystemHandler { | 20 class CFX_SystemHandler : public IFX_SystemHandler { |
22 public: | 21 public: |
23 CFX_SystemHandler(CPDFDoc_Environment* pEnv) : m_pEnv(pEnv), m_nCharSet(-1) {} | 22 CFX_SystemHandler(CPDFDoc_Environment* pEnv) : m_pEnv(pEnv), m_nCharSet(-1) {} |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 bsBcc.ReleaseBuffer(); | 366 bsBcc.ReleaseBuffer(); |
368 bsSubject.ReleaseBuffer(); | 367 bsSubject.ReleaseBuffer(); |
369 bsMsg.ReleaseBuffer(); | 368 bsMsg.ReleaseBuffer(); |
370 } | 369 } |
371 } | 370 } |
372 | 371 |
373 IFXJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { | 372 IFXJS_Runtime* CPDFDoc_Environment::GetJSRuntime() { |
374 if (!IsJSInitiated()) | 373 if (!IsJSInitiated()) |
375 return NULL; | 374 return NULL; |
376 if (!m_pJSRuntime) | 375 if (!m_pJSRuntime) |
377 m_pJSRuntime.reset(new CJS_Runtime(this)); | 376 m_pJSRuntime.reset(IFXJS_Runtime::Create(this)); |
378 return m_pJSRuntime.get(); | 377 return m_pJSRuntime.get(); |
379 } | 378 } |
380 | 379 |
381 CPDFSDK_AnnotHandlerMgr* CPDFDoc_Environment::GetAnnotHandlerMgr() { | 380 CPDFSDK_AnnotHandlerMgr* CPDFDoc_Environment::GetAnnotHandlerMgr() { |
382 if (!m_pAnnotHandlerMgr) | 381 if (!m_pAnnotHandlerMgr) |
383 m_pAnnotHandlerMgr = new CPDFSDK_AnnotHandlerMgr(this); | 382 m_pAnnotHandlerMgr = new CPDFSDK_AnnotHandlerMgr(this); |
384 return m_pAnnotHandlerMgr; | 383 return m_pAnnotHandlerMgr; |
385 } | 384 } |
386 | 385 |
387 CPDFSDK_ActionHandler* CPDFDoc_Environment::GetActionHander() { | 386 CPDFSDK_ActionHandler* CPDFDoc_Environment::GetActionHander() { |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 if (!pFocusAnnot) | 987 if (!pFocusAnnot) |
989 return NULL; | 988 return NULL; |
990 | 989 |
991 for (int i = 0; i < m_fxAnnotArray.GetSize(); i++) { | 990 for (int i = 0; i < m_fxAnnotArray.GetSize(); i++) { |
992 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); | 991 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); |
993 if (pAnnot == pFocusAnnot) | 992 if (pAnnot == pFocusAnnot) |
994 return pAnnot; | 993 return pAnnot; |
995 } | 994 } |
996 return NULL; | 995 return NULL; |
997 } | 996 } |
OLD | NEW |