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

Unified Diff: xfa/fxfa/app/xfa_ffimageedit.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/fxfa/app/xfa_ffimageedit.h ('k') | xfa/fxfa/app/xfa_ffpushbutton.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffimageedit.cpp
diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp
index 9e29119671039c419caf4ef193fc6cb46f2ad851..c174c6f673300e3396a4e72064218d67ae7a2b45 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.cpp
+++ b/xfa/fxfa/app/xfa_ffimageedit.cpp
@@ -6,10 +6,12 @@
#include "xfa/fxfa/app/xfa_ffimageedit.h"
+#include "third_party/base/ptr_util.h"
#include "xfa/fwl/core/cfwl_message.h"
#include "xfa/fwl/core/cfwl_picturebox.h"
#include "xfa/fwl/core/fwl_noteimp.h"
#include "xfa/fwl/core/ifwl_app.h"
+#include "xfa/fxfa/app/cxfa_ffimageeditdelegate.h"
#include "xfa/fxfa/app/xfa_fffield.h"
#include "xfa/fxfa/xfa_ffdoc.h"
#include "xfa/fxfa/xfa_ffdocview.h"
@@ -18,7 +20,8 @@
CXFA_FFImageEdit::CXFA_FFImageEdit(CXFA_FFPageView* pPageView,
CXFA_WidgetAcc* pDataAcc)
- : CXFA_FFField(pPageView, pDataAcc), m_pOldDelegate(nullptr) {}
+ : CXFA_FFField(pPageView, pDataAcc) {}
+
CXFA_FFImageEdit::~CXFA_FFImageEdit() {
CXFA_FFImageEdit::UnloadWidget();
}
@@ -32,8 +35,8 @@ FX_BOOL CXFA_FFImageEdit::LoadWidget() {
CFWL_NoteDriver* pNoteDriver = pWidget->GetOwnerApp()->GetNoteDriver();
pNoteDriver->RegisterEventTarget(pWidget, pWidget);
- m_pOldDelegate = pPictureBox->GetCurrentDelegate();
- pPictureBox->SetCurrentDelegate(this);
+ pPictureBox->SetDelegate(pdfium::MakeUnique<CXFA_FFImageEditDelegate>(
+ pPictureBox->ReleaseDelegate(), this));
CXFA_FFField::LoadWidget();
if (m_pDataAcc->GetImageEditImage()) {
@@ -125,16 +128,3 @@ FX_BOOL CXFA_FFImageEdit::UpdateFWLData() {
return TRUE;
}
-void CXFA_FFImageEdit::OnProcessMessage(CFWL_Message* pMessage) {
- m_pOldDelegate->OnProcessMessage(pMessage);
-}
-
-void CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) {
- CXFA_FFField::OnProcessEvent(pEvent);
- m_pOldDelegate->OnProcessEvent(pEvent);
-}
-
-void CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
-}
« no previous file with comments | « xfa/fxfa/app/xfa_ffimageedit.h ('k') | xfa/fxfa/app/xfa_ffpushbutton.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698