summaryrefslogtreecommitdiffstats
path: root/WebCore/page/Geolocation.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/page/Geolocation.h')
-rw-r--r--WebCore/page/Geolocation.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index fd9d560..5b5feb5 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -48,8 +48,16 @@ namespace WebCore {
class Frame;
class CachedPositionManager;
-
-class Geolocation : public GeolocationServiceClient, public EventListener {
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+class GeolocationPosition;
+class GeolocationError;
+#endif
+
+class Geolocation : public EventListener
+#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+ , public GeolocationServiceClient
+#endif
+{
public:
static PassRefPtr<Geolocation> create(Frame* frame) { return adoptRef(new Geolocation(frame)); }
@@ -57,7 +65,7 @@ public:
void disconnectFrame();
- Geoposition* lastPosition() const { return m_service->lastPosition(); }
+ Geoposition* lastPosition();
void getCurrentPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
int watchPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
@@ -73,6 +81,11 @@ public:
void setShouldClearCache(bool shouldClearCache) { m_shouldClearCache = shouldClearCache; }
bool shouldClearCache() const { return m_shouldClearCache; }
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+ void setPostion(GeolocationPosition*);
+ void setError(GeolocationError*);
+#endif
+
static void setDatabasePath(String);
private:
@@ -126,14 +139,20 @@ private:
void stopTimersForWatchers();
void stopTimers();
+ void positionChanged(PassRefPtr<Geoposition>);
void makeSuccessCallbacks();
void handleError(PositionError*);
void requestPermission();
+ bool startUpdating(PositionOptions*);
+ void stopUpdating();
+
+#if !ENABLE(CLIENT_BASED_GEOLOCATION)
// GeolocationServiceClient
virtual void geolocationServicePositionChanged(GeolocationService*);
virtual void geolocationServiceErrorOccurred(GeolocationService*);
+#endif
PassRefPtr<GeoNotifier> startRequest(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
@@ -151,7 +170,11 @@ private:
GeoNotifierSet m_oneShots;
Watchers m_watchers;
Frame* m_frame;
+#if !ENABLE(CLIENT_BASED_GEOLOCATION)
OwnPtr<GeolocationService> m_service;
+#endif
+ RefPtr<Geoposition> m_lastPosition;
+ RefPtr<Geoposition> m_currentPosition;
enum {
Unknown,