Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: xfa/fwl/core/ifwl_widget.cpp

Issue 2464703006: Fold IFWL*::{Initialize|Finalize} into constructor/destructor (Closed)
Patch Set: Rebase to master Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/ifwl_widget.cpp
diff --git a/xfa/fwl/core/ifwl_widget.cpp b/xfa/fwl/core/ifwl_widget.cpp
index da90c4892d25ddc6d93b59f1ac2e9bec3f7781c7..961c02497bd78e9a208a9986bc99ab3b466093c4 100644
--- a/xfa/fwl/core/ifwl_widget.cpp
+++ b/xfa/fwl/core/ifwl_widget.cpp
@@ -30,7 +30,6 @@ IFWL_Widget::IFWL_Widget(const IFWL_App* app,
: m_pOwnerApp(app),
m_pWidgetMgr(app->GetWidgetMgr()),
m_pProperties(new CFWL_WidgetImpProperties(properties)),
- m_pDelegate(nullptr),
m_pCurDelegate(nullptr),
m_pOuter(pOuter),
m_pLayoutItem(nullptr),
@@ -38,21 +37,18 @@ IFWL_Widget::IFWL_Widget(const IFWL_App* app,
m_iLock(0),
m_nEventKey(0) {
ASSERT(m_pWidgetMgr);
-}
-
-IFWL_Widget::~IFWL_Widget() {}
-void IFWL_Widget::Initialize() {
IFWL_Widget* pParent = m_pProperties->m_pParent;
m_pWidgetMgr->InsertWidget(pParent, this);
- if (!IsChild()) {
- IFWL_Widget* pOwner = m_pProperties->m_pOwner;
- if (pOwner)
- m_pWidgetMgr->SetOwner(pOwner, this);
- }
+ if (IsChild())
+ return;
+
+ IFWL_Widget* pOwner = m_pProperties->m_pOwner;
+ if (pOwner)
+ m_pWidgetMgr->SetOwner(pOwner, this);
}
-void IFWL_Widget::Finalize() {
+IFWL_Widget::~IFWL_Widget() {
NotifyDriver();
m_pWidgetMgr->RemoveWidget(this);
}
@@ -354,7 +350,7 @@ FWL_Error IFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
IFWL_WidgetDelegate* IFWL_Widget::GetCurrentDelegate() {
if (!m_pCurDelegate)
- m_pCurDelegate = m_pDelegate;
+ m_pCurDelegate = m_pDelegate.get();
return m_pCurDelegate;
}
« no previous file with comments | « xfa/fwl/core/ifwl_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698