diff options
Diffstat (limited to 'WebCore/page')
-rw-r--r-- | WebCore/page/Geolocation.cpp | 48 | ||||
-rw-r--r-- | WebCore/page/Geolocation.h | 15 |
2 files changed, 13 insertions, 50 deletions
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index 88e8941..49a4d84 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -31,10 +31,6 @@ #if ENABLE(GEOLOCATION) #include "Chrome.h" -// ANDROID -#include "DOMWindow.h" -#include "EventNames.h" -// END ANDROID #include "Frame.h" #include "Page.h" #if PLATFORM(ANDROID) @@ -208,10 +204,7 @@ void Geolocation::Watchers::getNotifiersVector(Vector<RefPtr<GeoNotifier> >& cop } Geolocation::Geolocation(Frame* frame) -// ANDROID - : EventListener(GeolocationEventListenerType) - , m_frame(frame) -// END ANDROID + : m_frame(frame) #if !ENABLE(CLIENT_BASED_GEOLOCATION) , m_service(GeolocationService::create(this)) #endif @@ -222,26 +215,23 @@ Geolocation::Geolocation(Frame* frame) return; ASSERT(m_frame->document()); m_frame->document()->setUsingGeolocation(true); - -// ANDROID - if (m_frame->domWindow()) - m_frame->domWindow()->addEventListener(eventNames().unloadEvent, this, false); -// END ANDROID } Geolocation::~Geolocation() { -// ANDROID - if (m_frame && m_frame->domWindow()) - m_frame->domWindow()->removeEventListener(eventNames().unloadEvent, this, false); -// END ANDROID +} + +void Geolocation::stop() +{ + m_oneShots.clear(); + m_watchers.clear(); + stopUpdating(); } void Geolocation::disconnectFrame() { if (m_frame && m_frame->page() && m_allowGeolocation == InProgress) m_frame->page()->chrome()->cancelGeolocationPermissionRequestForFrame(m_frame, this); - stopUpdating(); if (m_frame && m_frame->document()) m_frame->document()->setUsingGeolocation(false); m_frame = 0; @@ -684,26 +674,6 @@ void Geolocation::stopUpdating() } -// ANDROID -bool Geolocation::operator==(const EventListener& listener) -{ - if (listener.type() != GeolocationEventListenerType) - return false; - const Geolocation* geolocation = static_cast<const Geolocation*>(&listener); - return m_frame == geolocation->m_frame; -} - -void Geolocation::handleEvent(ScriptExecutionContext*, Event* event) -{ - ASSERT_UNUSED(event, event->type() == eventNames().unloadEvent); - // Cancel any ongoing requests on page unload. This is required to release - // references to JS callbacks in the page, to allow the frame to be cleaned up - // by WebKit. - m_oneShots.clear(); - m_watchers.clear(); -} -// END ANDROID - } // namespace WebCore #else @@ -720,6 +690,8 @@ Geolocation::~Geolocation() {} void Geolocation::setIsAllowed(bool) {} +void Geolocation::stop() {} + } #endif // ENABLE(GEOLOCATION) diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h index ba4f149..8803703 100644 --- a/WebCore/page/Geolocation.h +++ b/WebCore/page/Geolocation.h @@ -27,9 +27,6 @@ #ifndef Geolocation_h #define Geolocation_h -// ANDROID -#include "EventListener.h" -// END ANDROID #include "GeolocationPositionCache.h" #include "GeolocationService.h" #include "Geoposition.h" @@ -48,9 +45,7 @@ class GeolocationPosition; class GeolocationError; #endif -// ANDROID -class Geolocation : public EventListener -// END ANDROID +class Geolocation : public RefCounted<Geolocation> #if !ENABLE(CLIENT_BASED_GEOLOCATION) && ENABLE(GEOLOCATION) , public GeolocationServiceClient #endif @@ -70,6 +65,8 @@ public: void suspend(); void resume(); + void stop(); + void setIsAllowed(bool); Frame* frame() const { return m_frame; } @@ -154,12 +151,6 @@ private: PassRefPtr<GeoNotifier> startRequest(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>); -// ANDROID - // EventListener - virtual bool operator==(const EventListener&); - virtual void handleEvent(ScriptExecutionContext*, Event*); -// END ANDROID - void fatalErrorOccurred(GeoNotifier*); void requestTimedOut(GeoNotifier*); void requestUsesCachedPosition(GeoNotifier*); |