summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_timer.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-31 07:29:34 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-31 07:29:34 -0700
commit20855384b8149a631c3c1d229551523c12eb767b (patch)
treee3cef278e322742bea6c4b48f40ed580754ebd80 /xfa/fwl/core/ifwl_timer.cpp
parent747dcf775c5cb661e96a639f73322cc489d8590f (diff)
downloadpdfium-20855384b8149a631c3c1d229551523c12eb767b.tar.xz
Remove FWL globals.
This CL removes the FWL_GetApp, FWL_SetApp and FWL_GetWidgetAdapter methods. In the process it changes the various Initialize methods to return void. Review-Url: https://codereview.chromium.org/2436103002
Diffstat (limited to 'xfa/fwl/core/ifwl_timer.cpp')
-rw-r--r--xfa/fwl/core/ifwl_timer.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/xfa/fwl/core/ifwl_timer.cpp b/xfa/fwl/core/ifwl_timer.cpp
index 941113e7ca..3f81eec476 100644
--- a/xfa/fwl/core/ifwl_timer.cpp
+++ b/xfa/fwl/core/ifwl_timer.cpp
@@ -7,10 +7,15 @@
#include "xfa/fwl/core/ifwl_adaptertimermgr.h"
#include "xfa/fwl/core/ifwl_app.h"
#include "xfa/fwl/core/ifwl_timer.h"
+#include "xfa/fwl/core/ifwl_widget.h"
#include "xfa/fxfa/xfa_ffapp.h"
IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) {
- CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative();
+ const IFWL_App* pApp = m_pWidget->GetOwnerApp();
+ if (!pApp)
+ return nullptr;
+
+ CXFA_FFApp* pAdapterNative = pApp->GetAdapterNative();
if (!pAdapterNative)
return nullptr;
@@ -24,13 +29,5 @@ IFWL_TimerInfo* IFWL_Timer::StartTimer(uint32_t dwElapse, bool bImmediately) {
}
FWL_Error IFWL_TimerInfo::StopTimer() {
- CXFA_FFApp* pAdapterNative = FWL_GetAdapterNative();
- if (!pAdapterNative)
- return FWL_Error::Indefinite;
-
- IFWL_AdapterTimerMgr* pAdapterTimerMgr = pAdapterNative->GetTimerMgr();
- if (!pAdapterTimerMgr)
- return FWL_Error::Indefinite;
-
- return pAdapterTimerMgr->Stop(this);
+ return m_pMgr->Stop(this);
}