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

Unified Diff: fpdfsdk/cpdfsdk_widgethandler.cpp

Issue 2368403002: Watch destruction of widgets around OnAAction() method (Closed)
Patch Set: Pass everywhere Created 4 years, 3 months 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
Index: fpdfsdk/cpdfsdk_widgethandler.cpp
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index 3998cb4f8a68892f0464655b7afcb852fab43d98..3d878aca961d322793f87ee96e7ec4a9552e3195 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -110,21 +110,21 @@ void CPDFSDK_WidgetHandler::OnDelete(CPDFSDK_Annot* pAnnot) {}
void CPDFSDK_WidgetHandler::OnRelease(CPDFSDK_Annot* pAnnot) {}
void CPDFSDK_WidgetHandler::OnMouseEnter(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlag) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag);
}
void CPDFSDK_WidgetHandler::OnMouseExit(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlag) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag);
}
FX_BOOL CPDFSDK_WidgetHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlags,
const CFX_FloatPoint& point) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
@@ -134,7 +134,7 @@ FX_BOOL CPDFSDK_WidgetHandler::OnLButtonDown(CPDFSDK_PageView* pPageView,
}
FX_BOOL CPDFSDK_WidgetHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlags,
const CFX_FloatPoint& point) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
@@ -143,10 +143,11 @@ FX_BOOL CPDFSDK_WidgetHandler::OnLButtonUp(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CPDFSDK_WidgetHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CPDFSDK_WidgetHandler::OnLButtonDblClk(
+ CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point);
@@ -154,7 +155,7 @@ FX_BOOL CPDFSDK_WidgetHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
}
FX_BOOL CPDFSDK_WidgetHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlags,
const CFX_FloatPoint& point) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
@@ -164,7 +165,7 @@ FX_BOOL CPDFSDK_WidgetHandler::OnMouseMove(CPDFSDK_PageView* pPageView,
}
FX_BOOL CPDFSDK_WidgetHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlags,
short zDelta,
const CFX_FloatPoint& point) {
@@ -176,7 +177,7 @@ FX_BOOL CPDFSDK_WidgetHandler::OnMouseWheel(CPDFSDK_PageView* pPageView,
}
FX_BOOL CPDFSDK_WidgetHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlags,
const CFX_FloatPoint& point) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
@@ -186,7 +187,7 @@ FX_BOOL CPDFSDK_WidgetHandler::OnRButtonDown(CPDFSDK_PageView* pPageView,
}
FX_BOOL CPDFSDK_WidgetHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlags,
const CFX_FloatPoint& point) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
@@ -195,10 +196,11 @@ FX_BOOL CPDFSDK_WidgetHandler::OnRButtonUp(CPDFSDK_PageView* pPageView,
return FALSE;
}
-FX_BOOL CPDFSDK_WidgetHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView,
- CPDFSDK_Annot* pAnnot,
- uint32_t nFlags,
- const CFX_FloatPoint& point) {
+FX_BOOL CPDFSDK_WidgetHandler::OnRButtonDblClk(
+ CPDFSDK_PageView* pPageView,
+ CPDFSDK_Annot::ObservedPtr& pAnnot,
+ uint32_t nFlags,
+ const CFX_FloatPoint& point) {
return FALSE;
}
@@ -260,7 +262,7 @@ void CPDFSDK_WidgetHandler::OnLoad(CPDFSDK_Annot* pAnnot) {
m_pFormFiller->OnLoad(pAnnot);
}
-FX_BOOL CPDFSDK_WidgetHandler::OnSetFocus(CPDFSDK_Annot* pAnnot,
+FX_BOOL CPDFSDK_WidgetHandler::OnSetFocus(CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlag) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
return m_pFormFiller->OnSetFocus(pAnnot, nFlag);
@@ -268,7 +270,7 @@ FX_BOOL CPDFSDK_WidgetHandler::OnSetFocus(CPDFSDK_Annot* pAnnot,
return TRUE;
}
-FX_BOOL CPDFSDK_WidgetHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
+FX_BOOL CPDFSDK_WidgetHandler::OnKillFocus(CPDFSDK_Annot::ObservedPtr& pAnnot,
uint32_t nFlag) {
if (!pAnnot->IsSignatureWidget() && m_pFormFiller)
return m_pFormFiller->OnKillFocus(pAnnot, nFlag);
@@ -277,8 +279,9 @@ FX_BOOL CPDFSDK_WidgetHandler::OnKillFocus(CPDFSDK_Annot* pAnnot,
}
#ifdef PDF_ENABLE_XFA
-FX_BOOL CPDFSDK_WidgetHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot,
- CPDFSDK_Annot* pNewAnnot) {
+FX_BOOL CPDFSDK_WidgetHandler::OnXFAChangedFocus(
+ CPDFSDK_Annot::ObservedPtr& pOldAnnot,
+ CPDFSDK_Annot::ObservedPtr& pNewAnnot) {
return TRUE;
}
#endif // PDF_ENABLE_XFA

Powered by Google App Engine
This is Rietveld 408576698