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

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

Issue 2466273003: Change IFWL_Widget to store a single delegate. (Closed)
Patch Set: Fix Mac 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') | xfa/fxfa/app/cxfa_ffcheckbuttondelegate.h » ('j') | 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 961c02497bd78e9a208a9986bc99ab3b466093c4..e4b04d7d0645c8ac13fdfd2f4b20c90655413e08 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_pCurDelegate(nullptr),
m_pOuter(pOuter),
m_pLayoutItem(nullptr),
m_pAssociate(nullptr),
@@ -97,7 +96,7 @@ FWL_Error IFWL_Widget::SetWidgetRect(const CFX_RectF& rect) {
ev.m_rtOld = rtOld;
ev.m_rtNew = rect;
- if (IFWL_WidgetDelegate* pDelegate = GetCurrentDelegate())
+ if (IFWL_WidgetDelegate* pDelegate = GetDelegate())
pDelegate->OnProcessEvent(&ev);
}
return FWL_Error::Succeeded;
@@ -348,16 +347,6 @@ FWL_Error IFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
return FWL_Error::Succeeded;
}
-IFWL_WidgetDelegate* IFWL_Widget::GetCurrentDelegate() {
- if (!m_pCurDelegate)
- m_pCurDelegate = m_pDelegate.get();
- return m_pCurDelegate;
-}
-
-void IFWL_Widget::SetCurrentDelegate(IFWL_WidgetDelegate* pDelegate) {
- m_pCurDelegate = pDelegate;
-}
-
const IFWL_App* IFWL_Widget::GetOwnerApp() const {
return m_pOwnerApp;
}
@@ -720,7 +709,7 @@ void IFWL_Widget::DispatchKeyEvent(CFWL_MsgKey* pNote) {
void IFWL_Widget::DispatchEvent(CFWL_Event* pEvent) {
if (m_pOuter) {
- m_pOuter->GetCurrentDelegate()->OnProcessEvent(pEvent);
+ m_pOuter->GetDelegate()->OnProcessEvent(pEvent);
return;
}
const IFWL_App* pApp = GetOwnerApp();
« no previous file with comments | « xfa/fwl/core/ifwl_widget.h ('k') | xfa/fxfa/app/cxfa_ffcheckbuttondelegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698