From 3b3ce1a242f8445848d3f23d6c35ba01d7c645f4 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 2 Nov 2016 14:51:25 -0700 Subject: Merge delegates into IFWL_* classes. This Cl removes ownership of the delgates from IFWL_Widget and puts it in the hand of the creating classes. In doing so, merge the delegates back into the IFWL_* classes to simplify logic. Review-Url: https://codereview.chromium.org/2467993003 --- xfa/fwl/core/ifwl_tooltip.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'xfa/fwl/core/ifwl_tooltip.cpp') diff --git a/xfa/fwl/core/ifwl_tooltip.cpp b/xfa/fwl/core/ifwl_tooltip.cpp index 371709772e..200cf7adab 100644 --- a/xfa/fwl/core/ifwl_tooltip.cpp +++ b/xfa/fwl/core/ifwl_tooltip.cpp @@ -32,8 +32,6 @@ IFWL_ToolTip::IFWL_ToolTip(const IFWL_App* app, m_rtAnchor.Set(0, 0, 0, 0); m_pProperties->m_dwStyles &= ~FWL_WGTSTYLE_Child; m_pProperties->m_dwStyles |= FWL_WGTSTYLE_Popup; - - SetDelegate(pdfium::MakeUnique(this)); } IFWL_ToolTip::~IFWL_ToolTip() {} @@ -228,6 +226,11 @@ void IFWL_ToolTip::RefreshToolTipPos() { } } +void IFWL_ToolTip::OnDrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix) { + DrawWidget(pGraphics, pMatrix); +} + IFWL_ToolTip::Timer::Timer(IFWL_ToolTip* pToolTip) : IFWL_Timer(pToolTip) {} void IFWL_ToolTip::Timer::Run(IFWL_TimerInfo* pTimerInfo) { @@ -248,17 +251,3 @@ void IFWL_ToolTip::Timer::Run(IFWL_TimerInfo* pTimerInfo) { pToolTip->m_pTimerInfoHide = nullptr; } } - -CFWL_ToolTipImpDelegate::CFWL_ToolTipImpDelegate(IFWL_ToolTip* pOwner) - : m_pOwner(pOwner) {} - -void CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { - CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); -} - -void CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} - -void CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pOwner->DrawWidget(pGraphics, pMatrix); -} -- cgit v1.2.3