Each port of WebKit that wants to support Geolocation must implement the GeolocationService interface. So Android needs one too.
Created attachment 43308 [details] Android implementation of the GeolocationService implementation The corresponding code in the Android source tree can be found at http://android.git.kernel.org/?p=platform/external/webkit.git;a=tree;f=WebCore/platform/android;h=b66c3277d6de15bd67218256deeafa72925b557d;hb=refs/heads/eclair
Comment on attachment 43308 [details] Android implementation of the GeolocationService implementation > +// GeolocationServiceBridge is the bridge to the Java implementation. It manages > +// the lifetime of the Java object. It is an implementation detail of > +// GeolocationServiceAndroid. > +class GeolocationServiceBridge { Can you split this out into a separate file? > + static PassRefPtr<Geoposition> convertLocationToGeoposition(JNIEnv *env, const jobject &location); toGeoposition is shorter and more inline with the WebKit convention. > +static const char* kJavaGeolocationServiceClass = "android/webkit/GeolocationService"; prefix k* is not necessary, just use standard camelCase. > +enum kJavaGeolocationServiceClassMethods { > + GEOLOCATION_SERVICE_METHOD_INIT = 0, GeolocationServiceMethodInit <-- casing here and elsewhere > + GEOLOCATION_SERVICE_METHOD_START, > + GEOLOCATION_SERVICE_METHOD_STOP, > + GEOLOCATION_SERVICE_METHOD_SET_ENABLE_GPS, > + GEOLOCATION_SERVICE_METHOD_COUNT, > +};
Created attachment 43314 [details] Android implementation of the GeolocationService implementation v2
Created attachment 43315 [details] Android implementation of the GeolocationService implementation v2 The previous patch was missing new lines at the end of the new files.
Thanks Dimitri, (In reply to comment #2) > (From update of attachment 43308 [details]) > > +// GeolocationServiceBridge is the bridge to the Java implementation. It manages > > +// the lifetime of the Java object. It is an implementation detail of > > +// GeolocationServiceAndroid. > > +class GeolocationServiceBridge { > > Can you split this out into a separate file? > Sure, done. > > + static PassRefPtr<Geoposition> convertLocationToGeoposition(JNIEnv *env, const jobject &location); > > toGeoposition is shorter and more inline with the WebKit convention. > Indeed. Changed. > > +static const char* kJavaGeolocationServiceClass = "android/webkit/GeolocationService"; > > prefix k* is not necessary, just use standard camelCase. > Done. > > +enum kJavaGeolocationServiceClassMethods { > > + GEOLOCATION_SERVICE_METHOD_INIT = 0, > > GeolocationServiceMethodInit <-- casing here and elsewhere > Fixed. Andrei
Comment on attachment 43315 [details] Android implementation of the GeolocationService implementation v2 looks good.
Comment on attachment 43315 [details] Android implementation of the GeolocationService implementation v2 Will land this manually as the commit queue is currently disabled.
Landed as r51071.