[Gtk] Support for client-based geolocation
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 13:03:04 +0000 (13:03 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Oct 2011 13:03:04 +0000 (13:03 +0000)
commit9ec5d1558e899ba34bd4a790393af4a7239b99f0
treec8cf6b7cd38cbadf232ffb04cb737fb27713ae4a
parent6f7ebcda9ee7b49dfe13140fc840df133e9333a8
[Gtk] Support for client-based geolocation
https://bugs.webkit.org/show_bug.cgi?id=64970

Patch by Zan Dobersek <zandobersek@gmail.com> on 2011-10-18
Reviewed by Martin Robinson.

.:

Remove flag for enabling client-based geolocation since
it is used by default on Gtk port and hence not configurable.

* configure.ac:

Source/WebCore:

Add feature defines for client-based geolocation when geolocation is enabled,
since this is the providing method that is now used by default. Remove
service-based providing method completely as it is not needed anymore.

* GNUmakefile.am: Add feature defines for client-based geolocation.
* GNUmakefile.list.am: Remove GeolocationServiceGtk.* files from compilation.
* platform/gtk/GeolocationServiceGtk.cpp: Removed.
* platform/gtk/GeolocationServiceGtk.h: Removed.

Source/WebKit/gtk:

Add DumpRenderTree support functions for client-based geolocation tests
and implement GeolocationClientGtk. The implementation is based on Zecke's
implementation of GeolocationService class in WebCore, which is now redundant
and subsequently removed.

* GNUmakefile.am: Add GeolocationClientGtk.* files to compilation.
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp: Add support functions to operate
with GeolocationClientMock.
(DumpRenderTreeSupportGtk::resetGeolocationClientMock):
(DumpRenderTreeSupportGtk::setMockGeolocationPermission):
(DumpRenderTreeSupportGtk::setMockGeolocationPosition):
(DumpRenderTreeSupportGtk::setMockGeolocationError):
(DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests):
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
* WebCoreSupport/GeolocationClientGtk.cpp: Added.
(WebKit::getPositionCallback):
(WebKit::positionChangedCallback):
(WebKit::GeolocationClient::GeolocationClient):
(WebKit::GeolocationClient::geolocationDestroyed):
(WebKit::GeolocationClient::startUpdating):
(WebKit::GeolocationClient::stopUpdating):
(WebKit::GeolocationClient::setEnableHighAccuracy):
(WebKit::GeolocationClient::lastPosition):
(WebKit::GeolocationClient::requestPermission):
(WebKit::GeolocationClient::cancelPermissionRequest):
(WebKit::GeolocationClient::positionChanged):
(WebKit::GeolocationClient::updatePosition):
(WebKit::GeolocationClient::errorOccured):
* WebCoreSupport/GeolocationClientGtk.h: Added.
* webkit/webkitwebview.cpp:
(webkit_web_view_init): Use GeolocationClientMock as geolocation client
when running in DumpRenderTree.

Tools:

Add support for testing client-based geolocation tests in DumpRenderTree.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues): Reset GeolocationClientMock.
(createWebView): Create web view after declaring DumpRenderTree mode.
That way a mock client for geolocation is used instead of a GeoClue
client if a web view is created when testing.
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Implement functions for
geolocation layout tests.
(LayoutTestController::setMockGeolocationPosition):
(LayoutTestController::setMockGeolocationError):
(LayoutTestController::setGeolocationPermission):
(LayoutTestController::numberOfPendingGeolocationPermissionRequests):
* Scripts/build-webkit: Note that the Gtk port is using client-based
geolocation, even though changing this flag has no effect on compilation.

LayoutTests:

Unskip geolocation tests that now pass.

* platform/gtk/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/GNUmakefile.list.am
Source/WebCore/platform/gtk/GeolocationServiceGtk.cpp [deleted file]
Source/WebCore/platform/gtk/GeolocationServiceGtk.h [deleted file]
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
Source/WebKit/gtk/WebCoreSupport/GeolocationClientGtk.cpp [new file with mode: 0644]
Source/WebKit/gtk/WebCoreSupport/GeolocationClientGtk.h [new file with mode: 0644]
Source/WebKit/gtk/webkit/webkitwebview.cpp
Tools/ChangeLog
Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
Tools/Scripts/build-webkit
configure.ac