| Index: webkit/chaos/ChaosGeolocation.h
|
| ===================================================================
|
| --- webkit/chaos/ChaosGeolocation.h (revision 0)
|
| +++ webkit/chaos/ChaosGeolocation.h (revision 0)
|
| @@ -0,0 +1,81 @@
|
| +#ifndef ChaosGeolocation_h
|
| +#define ChaosGeolocation_h
|
| +
|
| +#include "ChaosPositionCallback.h"
|
| +#include "PositionErrorCallback.h"
|
| +#include "Timer.h"
|
| +#include <wtf/HashMap.h>
|
| +#include <wtf/HashSet.h>
|
| +#include <wtf/PassRefPtr.h>
|
| +#include <wtf/RefCounted.h>
|
| +
|
| +#include <string>
|
| +
|
| +namespace WebCore {
|
| +
|
| +class ChaosCoordinates;
|
| +class ChaosPositionCallback;
|
| +class ChaosGeoposition;
|
| +class PositionErrorCallback;
|
| +
|
| +class ChaosGeolocationImpl {
|
| + public:
|
| + virtual ChaosCoordinates *coords() const = 0;
|
| + virtual std::string describe() const = 0;
|
| +};
|
| +
|
| +class ChaosGeolocation : public RefCounted<ChaosGeolocation> {
|
| + public:
|
| + ChaosGeolocation();
|
| + // ChaosCoordinates *coords();
|
| + ChaosGeoposition *lastPosition();
|
| + void getCurrentPosition(PassRefPtr<ChaosPositionCallback>/*,
|
| + PassRefPtr<PositionErrorCallback>,
|
| + PassRefPtr<PositionOptions>*/);
|
| + int watchPosition(PassRefPtr<ChaosPositionCallback>/*,
|
| + PassRefPtr<PositionErrorCallback>,
|
| + PassRefPtr<PositionOptions>*/);
|
| + void clearWatch(long watchId);
|
| +
|
| + // For the powerbox
|
| + // Called when the user chooses an implementation
|
| + void OnProviderChosen(ChaosGeolocationImpl *impl);
|
| +
|
| + private:
|
| +
|
| + class GeoNotifier : public RefCounted<GeoNotifier> {
|
| + public:
|
| + static PassRefPtr<GeoNotifier>
|
| + create(ChaosGeolocation *parent,
|
| + PassRefPtr<ChaosPositionCallback> positionCallback/*,
|
| + PassRefPtr<PositionErrorCallback> positionErrorCallback*/) {
|
| + return adoptRef(new GeoNotifier(parent, positionCallback/*,
|
| + positionErrorCallback*/));
|
| + }
|
| +
|
| + void startTimer();
|
| + void timerFired(Timer<GeoNotifier> *);
|
| +
|
| + private:
|
| + GeoNotifier(ChaosGeolocation *parent, PassRefPtr<ChaosPositionCallback>/*,
|
| + PassRefPtr<PositionErrorCallback>*/);
|
| +
|
| + RefPtr<ChaosPositionCallback> successCallback_;
|
| + //RefPtr<PositionErrorCallback> errorCallback_;
|
| + // RefPtr<PositionOptions> m_options;
|
| + Timer<GeoNotifier> timer_;
|
| + ChaosGeolocation *parent_;
|
| + };
|
| +
|
| + typedef HashSet<RefPtr<GeoNotifier> > GeoNotifierSet;
|
| + typedef HashMap<int, RefPtr<GeoNotifier> > GeoNotifierMap;
|
| +
|
| + GeoNotifierSet oneShots_;
|
| + GeoNotifierMap watchers_;
|
| +
|
| + ChaosGeolocationImpl *impl_;
|
| +};
|
| +
|
| +} // namespace WebCore
|
| +
|
| +#endif // ChaosGeolocation_h
|
|
|
| Property changes on: webkit/chaos/ChaosGeolocation.h
|
| ___________________________________________________________________
|
| Added: svn:eol-style
|
| + LF
|
|
|
|
|