| OLD | NEW |
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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 "../../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../../third_party/base/nonstd_unique_ptr.h" |
| 8 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. | 8 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. |
| 9 #include "../../include/javascript/IJavaScript.h" | 9 #include "../../include/javascript/IJavaScript.h" |
| 10 | 10 |
| 11 class CJS_ContextStub final : public IJS_Context { | 11 class CJS_ContextStub final : public IJS_Context { |
| 12 public: | 12 public: |
| 13 CJS_ContextStub() {} | 13 CJS_ContextStub() {} |
| 14 ~CJS_ContextStub() override {} | 14 ~CJS_ContextStub() override {} |
| 15 | 15 |
| 16 // IJS_Context: | 16 // IJS_Context: |
| 17 FX_BOOL RunScript(const CFX_WideString& script, | 17 FX_BOOL RunScript(const CFX_WideString& script, |
| 18 CFX_WideString& info) override { | 18 CFX_WideString* info) override { |
| 19 return FALSE; | 19 return FALSE; |
| 20 } | 20 } |
| 21 | 21 |
| 22 void OnApp_Init() override {} | 22 void OnApp_Init() override {} |
| 23 void OnDoc_Open(CPDFSDK_Document* pDoc, | 23 void OnDoc_Open(CPDFSDK_Document* pDoc, |
| 24 const CFX_WideString& strTargetName) override {} | 24 const CFX_WideString& strTargetName) override {} |
| 25 void OnDoc_WillPrint(CPDFSDK_Document* pDoc) override {} | 25 void OnDoc_WillPrint(CPDFSDK_Document* pDoc) override {} |
| 26 void OnDoc_DidPrint(CPDFSDK_Document* pDoc) override {} | 26 void OnDoc_DidPrint(CPDFSDK_Document* pDoc) override {} |
| 27 void OnDoc_WillSave(CPDFSDK_Document* pDoc) override {} | 27 void OnDoc_WillSave(CPDFSDK_Document* pDoc) override {} |
| 28 void OnDoc_DidSave(CPDFSDK_Document* pDoc) override {} | 28 void OnDoc_DidSave(CPDFSDK_Document* pDoc) override {} |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 virtual FX_BOOL GetHValueByName(const CFX_ByteStringC&, | 139 virtual FX_BOOL GetHValueByName(const CFX_ByteStringC&, |
| 140 FXJSE_HVALUE) override { | 140 FXJSE_HVALUE) override { |
| 141 return FALSE; | 141 return FALSE; |
| 142 } | 142 } |
| 143 | 143 |
| 144 virtual FX_BOOL SetHValueByName(const CFX_ByteStringC&, | 144 virtual FX_BOOL SetHValueByName(const CFX_ByteStringC&, |
| 145 FXJSE_HVALUE) override { | 145 FXJSE_HVALUE) override { |
| 146 return FALSE; | 146 return FALSE; |
| 147 } | 147 } |
| 148 | 148 |
| 149 int Execute(IJS_Context* cc, |
| 150 const wchar_t* script, |
| 151 CFX_WideString* info) override { |
| 152 return 0; |
| 153 } |
| 154 |
| 149 protected: | 155 protected: |
| 150 CPDFSDK_Document* m_pDoc; | 156 CPDFSDK_Document* m_pDoc; |
| 151 nonstd::unique_ptr<CJS_ContextStub> m_pContext; | 157 nonstd::unique_ptr<CJS_ContextStub> m_pContext; |
| 152 }; | 158 }; |
| 153 | 159 |
| 154 // static | 160 // static |
| 155 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { | 161 void IJS_Runtime::Initialize(unsigned int slot, void* isolate) { |
| 156 } | 162 } |
| 157 | 163 |
| 158 // static | 164 // static |
| 159 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { | 165 IJS_Runtime* IJS_Runtime::Create(CPDFDoc_Environment* pEnv) { |
| 160 return new CJS_RuntimeStub; | 166 return new CJS_RuntimeStub; |
| 161 } | 167 } |
| OLD | NEW |