[GTK][WPE] Add API to provide geolocation information
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2019 10:10:35 +0000 (10:10 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Mar 2019 10:10:35 +0000 (10:10 +0000)
commitcfe7e094228b185ed11e295ee6bbced3c83b1b59
tree165d05ac5c09290786c5fa542e61b1a022394bce
parent6f0b36f909b8f2cdc437beb552b6949776f2d25e
[GTK][WPE] Add API to provide geolocation information
https://bugs.webkit.org/show_bug.cgi?id=195940

Reviewed by Michael Catanzaro.

.:

Build with geolocation enabled by default in both GTK and WPE. In GTK add a specific USE_GEOCLUE build option
instead of using ENABLE_GEOLOCATION.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).

* PlatformGTK.cmake:
* platform/geoclue/GeolocationProviderGeoclue.cpp:
* platform/geoclue/GeolocationProviderGeoclue.h:
* platform/geoclue/GeolocationProviderGeoclueClient.h:

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add WebKitGeolocationManager.cpp.

Source/WebKit:

Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
(_WebKitGeolocationPosition::_WebKitGeolocationPosition):
(webkit_geolocation_position_new):
(webkit_geolocation_position_copy):
(webkit_geolocation_position_free):
(webkit_geolocation_position_set_timestamp):
(webkit_geolocation_position_set_altitude):
(webkit_geolocation_position_set_altitude_accuracy):
(webkit_geolocation_position_set_heading):
(webkit_geolocation_position_set_speed):
(webkitGeolocationManagerStop):
(webkitGeolocationManagerSetEnableHighAccuracy):
(webkitGeolocationManagerCreate):
(webkitGeolocationManagerGetProperty):
(webkit_geolocation_manager_class_init):
(webkit_gelocation_manager_update_position):
(webkit_gelocation_manager_failed):
(webkit_geolocation_manager_get_enable_high_accuracy):
* UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
* UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
* UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
(webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
* UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
* UIProcess/API/wpe/WebKitWebContext.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:

Tools:

Add a new test to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp: Added.
(testGeolocationManagerCurrentPosition):
(testGeolocationManagerWatchPosition):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewGeolocationPermissionRequests): Stop using ENABLE(GEOLOCATION) conditionals for geolocation tests.
(beforeAll): Ditto.
* TestWebKitAPI/glib/CMakeLists.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h
Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h
Source/WebCore/platform/gtk/po/ChangeLog
Source/WebCore/platform/gtk/po/POTFILES.in
Source/WebKit/ChangeLog
Source/WebKit/PlatformGTK.cmake
Source/WebKit/PlatformWPE.cmake
Source/WebKit/SourcesGTK.txt
Source/WebKit/SourcesWPE.txt
Source/WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/glib/WebKitGeolocationManagerPrivate.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp [deleted file]
Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.h [deleted file]
Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
Source/WebKit/UIProcess/API/gtk/WebKitGeolocationManager.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h
Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt
Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0.types
Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
Source/WebKit/UIProcess/API/gtk/webkit2.h
Source/WebKit/UIProcess/API/wpe/WebKitGeolocationManager.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h
Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt
Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml
Source/WebKit/UIProcess/API/wpe/webkit.h
Source/cmake/OptionsGTK.cmake
Source/cmake/OptionsWPE.cmake
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp
Tools/TestWebKitAPI/glib/CMakeLists.txt