summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_widget.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-31 07:29:34 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-31 07:29:34 -0700
commit20855384b8149a631c3c1d229551523c12eb767b (patch)
treee3cef278e322742bea6c4b48f40ed580754ebd80 /xfa/fwl/core/cfwl_widget.cpp
parent747dcf775c5cb661e96a639f73322cc489d8590f (diff)
downloadpdfium-20855384b8149a631c3c1d229551523c12eb767b.tar.xz
Remove FWL globals.
This CL removes the FWL_GetApp, FWL_SetApp and FWL_GetWidgetAdapter methods. In the process it changes the various Initialize methods to return void. Review-Url: https://codereview.chromium.org/2436103002
Diffstat (limited to 'xfa/fwl/core/cfwl_widget.cpp')
-rw-r--r--xfa/fwl/core/cfwl_widget.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp
index 7f6bd3b07c..d7903ea8a8 100644
--- a/xfa/fwl/core/cfwl_widget.cpp
+++ b/xfa/fwl/core/cfwl_widget.cpp
@@ -18,9 +18,10 @@
#define FWL_WGT_CalcWidth 2048
#define FWL_WGT_CalcMultiLineDefWidth 120.0f
-CFWL_Widget::CFWL_Widget()
- : m_pDelegate(nullptr),
- m_pWidgetMgr(CFWL_WidgetMgr::GetInstance()),
+CFWL_Widget::CFWL_Widget(const IFWL_App* app)
+ : m_pApp(app),
+ m_pDelegate(nullptr),
+ m_pWidgetMgr(app->GetWidgetMgr()),
m_pProperties(new CFWL_WidgetProperties) {
ASSERT(m_pWidgetMgr);
}
@@ -30,6 +31,11 @@ CFWL_Widget::~CFWL_Widget() {
m_pIface->Finalize();
}
+void CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) {
+ ASSERT(m_pIface);
+ m_pIface->SetAssociateWidget(this);
+}
+
IFWL_Widget* CFWL_Widget::GetWidget() {
return m_pIface.get();
}
@@ -38,13 +44,6 @@ const IFWL_Widget* CFWL_Widget::GetWidget() const {
return m_pIface.get();
}
-FWL_Error CFWL_Widget::Initialize(const CFWL_WidgetProperties* pProperties) {
- if (!m_pIface)
- return FWL_Error::Indefinite;
- m_pIface->SetAssociateWidget(this);
- return FWL_Error::Succeeded;
-}
-
FWL_Error CFWL_Widget::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
if (!m_pIface)
return FWL_Error::Indefinite;