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

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

Issue 2459423003: Rename IFWL_Widget::SetDelegate (Closed)
Patch Set: Review feedback 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/xfa_ffbarcode.cpp » ('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 eb8b1281e96ba5014475bdaec8c8f358e87a2017..da90c4892d25ddc6d93b59f1ac2e9bec3f7781c7 100644
--- a/xfa/fwl/core/ifwl_widget.cpp
+++ b/xfa/fwl/core/ifwl_widget.cpp
@@ -100,10 +100,9 @@ FWL_Error IFWL_Widget::SetWidgetRect(const CFX_RectF& rect) {
ev.m_pSrcTarget = this;
ev.m_rtOld = rtOld;
ev.m_rtNew = rect;
- IFWL_WidgetDelegate* pDelegate = SetDelegate(nullptr);
- if (pDelegate) {
+
+ if (IFWL_WidgetDelegate* pDelegate = GetCurrentDelegate())
pDelegate->OnProcessEvent(&ev);
- }
}
return FWL_Error::Succeeded;
}
@@ -353,16 +352,14 @@ FWL_Error IFWL_Widget::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
return FWL_Error::Succeeded;
}
-IFWL_WidgetDelegate* IFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) {
- if (!m_pCurDelegate) {
+IFWL_WidgetDelegate* IFWL_Widget::GetCurrentDelegate() {
+ if (!m_pCurDelegate)
m_pCurDelegate = m_pDelegate;
- }
- if (!pDelegate) {
- return m_pCurDelegate;
- }
- IFWL_WidgetDelegate* pOldDelegate = m_pCurDelegate;
+ return m_pCurDelegate;
+}
+
+void IFWL_Widget::SetCurrentDelegate(IFWL_WidgetDelegate* pDelegate) {
m_pCurDelegate = pDelegate;
- return pOldDelegate;
}
const IFWL_App* IFWL_Widget::GetOwnerApp() const {
@@ -727,8 +724,7 @@ void IFWL_Widget::DispatchKeyEvent(CFWL_MsgKey* pNote) {
void IFWL_Widget::DispatchEvent(CFWL_Event* pEvent) {
if (m_pOuter) {
- IFWL_WidgetDelegate* pDelegate = m_pOuter->SetDelegate(nullptr);
- pDelegate->OnProcessEvent(pEvent);
+ m_pOuter->GetCurrentDelegate()->OnProcessEvent(pEvent);
return;
}
const IFWL_App* pApp = GetOwnerApp();
« no previous file with comments | « xfa/fwl/core/ifwl_widget.h ('k') | xfa/fxfa/app/xfa_ffbarcode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698