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_caret.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'xfa/fwl/core/ifwl_caret.cpp') diff --git a/xfa/fwl/core/ifwl_caret.cpp b/xfa/fwl/core/ifwl_caret.cpp index 2dd1866642..94b56e8cf9 100644 --- a/xfa/fwl/core/ifwl_caret.cpp +++ b/xfa/fwl/core/ifwl_caret.cpp @@ -22,7 +22,6 @@ IFWL_Caret::IFWL_Caret(const IFWL_App* app, m_dwElapse(400), m_bSetColor(FALSE) { SetStates(FWL_STATE_CAT_HightLight); - SetDelegate(pdfium::MakeUnique(this)); } IFWL_Caret::~IFWL_Caret() { @@ -99,6 +98,13 @@ void IFWL_Caret::DrawCaretBK(CFX_Graphics* pGraphics, pTheme->DrawBackground(¶m); } +void IFWL_Caret::OnProcessMessage(CFWL_Message* pMessage) {} + +void IFWL_Caret::OnDrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix) { + DrawWidget(pGraphics, pMatrix); +} + IFWL_Caret::Timer::Timer(IFWL_Caret* pCaret) : IFWL_Timer(pCaret) {} void IFWL_Caret::Timer::Run(IFWL_TimerInfo* pTimerInfo) { @@ -111,13 +117,3 @@ void IFWL_Caret::Timer::Run(IFWL_TimerInfo* pTimerInfo) { rt.Set(0, 0, rt.width + 1, rt.height); pCaret->Repaint(&rt); } - -CFWL_CaretImpDelegate::CFWL_CaretImpDelegate(IFWL_Caret* pOwner) - : m_pOwner(pOwner) {} - -void CFWL_CaretImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {} - -void CFWL_CaretImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { - m_pOwner->DrawWidget(pGraphics, pMatrix); -} -- cgit v1.2.3