From a5eb9f05b7c3f82630784e043ccf75c4e019b18f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 21 Sep 2017 15:43:56 -0400 Subject: Cleanup WidgetMgr ownership The CXFA_FFApp can get the FWLWidgetMgr from the CFWL_App and does not need to store a copy. This removes the need to pass the delegate into the GetFWLAdapterWidgetMgr() method and we can set the capabilities directy. Change-Id: If4794d07fa0fb5dd32b816a21f04e6d7710886ca Reviewed-on: https://pdfium-review.googlesource.com/14611 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima --- xfa/fxfa/cxfa_ffapp.cpp | 8 ++------ xfa/fxfa/cxfa_ffapp.h | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp index 7ef266b1e5..8ec23e19c4 100644 --- a/xfa/fxfa/cxfa_ffapp.cpp +++ b/xfa/fxfa/cxfa_ffapp.cpp @@ -78,13 +78,9 @@ CXFA_FWLTheme* CXFA_FFApp::GetFWLTheme() { return m_pFWLTheme.get(); } -CXFA_FWLAdapterWidgetMgr* CXFA_FFApp::GetFWLAdapterWidgetMgr( - CFWL_WidgetMgr* pDelegate) { - if (!m_pAdapterWidgetMgr) { +CXFA_FWLAdapterWidgetMgr* CXFA_FFApp::GetFWLAdapterWidgetMgr() { + if (!m_pAdapterWidgetMgr) m_pAdapterWidgetMgr = pdfium::MakeUnique(); - pDelegate->OnSetCapability(FWL_WGTMGR_DisableForm); - m_pWidgetMgr = pDelegate; - } return m_pAdapterWidgetMgr.get(); } diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h index 4f2a06db0a..6ee9e45a13 100644 --- a/xfa/fxfa/cxfa_ffapp.h +++ b/xfa/fxfa/cxfa_ffapp.h @@ -37,8 +37,8 @@ class CXFA_FFApp { CXFA_FFDocHandler* GetDocHandler(); - CXFA_FWLAdapterWidgetMgr* GetFWLAdapterWidgetMgr(CFWL_WidgetMgr* pDelegate); - CFWL_WidgetMgr* GetFWLWidgetMgr() const { return m_pWidgetMgr.Get(); } + CXFA_FWLAdapterWidgetMgr* GetFWLAdapterWidgetMgr(); + CFWL_WidgetMgr* GetFWLWidgetMgr() const { return m_pFWLApp->GetWidgetMgr(); } CFGAS_FontMgr* GetFDEFontMgr(); CXFA_FWLTheme* GetFWLTheme(); @@ -76,10 +76,6 @@ class CXFA_FFApp { // may refers to theme manager and the latter refers to font manager. std::unique_ptr m_pFWLTheme; std::unique_ptr m_pFWLApp; - - // |m_pWidgetMgr| has to be released before |m_pFWLApp|, since - // |m_pFWLApp| is its owner. - CFX_UnownedPtr m_pWidgetMgr; }; #endif // XFA_FXFA_CXFA_FFAPP_H_ -- cgit v1.2.3