summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_app.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-01 11:22:37 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-01 11:22:37 -0700
commit8837c91c0db8f9205b7e58db97946e9af7958b39 (patch)
treeaa23430c284fe741685327e4f4704b2846514c54 /fpdfsdk/fpdfxfa/cpdfxfa_app.h
parentfcb1728c35f97a67fa0297f12bb13d3cafb01fe1 (diff)
downloadpdfium-8837c91c0db8f9205b7e58db97946e9af7958b39.tar.xz
Reland: Make the CPDFXFA_App non-globalchromium/2907
This reverts commit a282c7380f3964de41ea93c9980b12c4513d3473. This CL changes CPDFXFA_App from a global object to a child of the CPDFXFA_Document objects. BUG=pdfium:623 Review-Url: https://codereview.chromium.org/2421603002
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_app.h')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_app.h24
1 files changed, 6 insertions, 18 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_app.h b/fpdfsdk/fpdfxfa/cpdfxfa_app.h
index 9ec045f540..763f88da96 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_app.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_app.h
@@ -7,31 +7,22 @@
#ifndef FPDFSDK_FPDFXFA_CPDFXFA_APP_H_
#define FPDFSDK_FPDFXFA_CPDFXFA_APP_H_
+#include "third_party/base/ptr_util.h"
#include "xfa/fxfa/fxfa.h"
class CPDFSDK_FormFillEnvironment;
-class IFXJS_Runtime;
+class CJS_Runtime;
class CPDFXFA_App : public IXFA_AppProvider {
public:
- static CPDFXFA_App* GetInstance();
- static void ReleaseInstance();
-
CPDFXFA_App();
~CPDFXFA_App() override;
- FX_BOOL Initialize(v8::Isolate* pIsolate);
CXFA_FFApp* GetXFAApp() { return m_pXFAApp.get(); }
- FX_BOOL AddFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv);
- FX_BOOL RemoveFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv);
-
- FX_BOOL IsJavaScriptInitialized() const { return m_bJavaScriptInitialized; }
- void SetJavaScriptInitialized(FX_BOOL bInitialized) {
- m_bJavaScriptInitialized = bInitialized;
- }
+ void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv);
- v8::Isolate* GetJSERuntime() const { return m_pIsolate; }
+ v8::Isolate* GetJSERuntime() const;
// IFXA_AppProvider:
void GetLanguage(CFX_WideString& wsLanguage) override;
@@ -62,12 +53,9 @@ class CPDFXFA_App : public IXFA_AppProvider {
void LoadString(int32_t iStringID, CFX_WideString& wsString) override;
IFWL_AdapterTimerMgr* GetTimerMgr() override;
- CFX_ArrayTemplate<CPDFSDK_FormFillEnvironment*> m_pFormFillEnvList;
-
- protected:
- FX_BOOL m_bJavaScriptInitialized;
+ private:
+ CPDFSDK_FormFillEnvironment* m_pFormFillEnv; // Not owned.
std::unique_ptr<CXFA_FFApp> m_pXFAApp;
- v8::Isolate* m_pIsolate;
};
#endif // FPDFSDK_FPDFXFA_CPDFXFA_APP_H_