Skip to content

Commit

Permalink
[GTK][WPE] Add API to provide geolocation information
Browse files Browse the repository at this point in the history
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: http://svn.webkit.org/repository/webkit/trunk@243285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Mar 21, 2019
1 parent 97a555f commit 389b561
Show file tree
Hide file tree
Showing 35 changed files with 1,308 additions and 181 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2019-03-21 Carlos Garcia Campos <[email protected]>

[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:

2019-03-20 Simon Fraser <[email protected]>

Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
Expand Down
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2019-03-21 Carlos Garcia Campos <[email protected]>

[GTK][WPE] Add API to provide geolocation information
https://bugs.webkit.org/show_bug.cgi?id=195940

Reviewed by Michael Catanzaro.

Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).

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

2019-03-21 Carlos Garcia Campos <[email protected]>

[WPE] Confusing messages in stderr when surfaceless context is not supported
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/PlatformGTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ list(APPEND WebCorePlatformGTK_SOURCES
rendering/RenderThemeGtk.cpp
)

if (ENABLE_GEOLOCATION)
if (USE_GEOCLUE)
list(APPEND WebCore_SOURCES
${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "config.h"
#include "GeolocationProviderGeoclue.h"

#if ENABLE(GEOLOCATION)
#if USE(GEOCLUE)

#include <wtf/glib/GLibUtilities.h>
#include <wtf/glib/GUniquePtr.h>
Expand Down Expand Up @@ -212,4 +212,4 @@ void GeolocationProviderGeoclue::updateClientRequirements()

} // namespace WebCore

#endif // ENABLE(GEOLOCATION)
#endif // USE(GEOCLUE)
9 changes: 3 additions & 6 deletions Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef GeolocationProviderGeoclue_h
#define GeolocationProviderGeoclue_h
#pragma once

#if ENABLE(GEOLOCATION)
#if USE(GEOCLUE)

#include "GeolocationProviderGeoclueClient.h"
#include <wtf/glib/GRefPtr.h>
Expand Down Expand Up @@ -71,6 +70,4 @@ class GeolocationProviderGeoclue {

} // namespace WebCore

#endif // ENABLE(GEOLOCATION)

#endif // GeolocationProviderGeoclue_h
#endif // USE(GEOCLUE)
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
* Boston, MA 02110-1301, USA.
*/

#ifndef GeolocationProviderGeoclueClient_h
#define GeolocationProviderGeoclueClient_h
#pragma once

#if ENABLE(GEOLOCATION)
#if USE(GEOCLUE)

namespace WebCore {

Expand All @@ -32,6 +31,4 @@ class GeolocationProviderGeoclueClient {

} // namespace WebCore

#endif // ENABLE(GEOLOCATION)

#endif // GeolocationProviderGeoclueClient_h
#endif // USE(GEOCLUE)
9 changes: 9 additions & 0 deletions Source/WebCore/platform/gtk/po/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2019-03-21 Carlos Garcia Campos <[email protected]>

[GTK][WPE] Add API to provide geolocation information
https://bugs.webkit.org/show_bug.cgi?id=195940

Reviewed by Michael Catanzaro.

* POTFILES.in: Add WebKitGeolocationManager.cpp.

2019-03-13 Milo Casagrande <[email protected]>

[l10n] Updated Italian translation of WebKitGTK+
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/gtk/po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ LocalizedStringsGtk.cpp
../../../WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp
../../../WebKit/UIProcess/API/glib/WebKitFileChooserRequest.cpp
../../../WebKit/UIProcess/API/glib/WebKitFindController.cpp
../../../WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp
../../../WebKit/UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp
../../../WebKit/UIProcess/API/glib/WebKitNotification.cpp
../../../WebKit/UIProcess/API/glib/WebKitResponsePolicyDecision.cpp
Expand Down
50 changes: 50 additions & 0 deletions Source/WebKit/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
2019-03-21 Carlos Garcia Campos <[email protected]>

[GTK][WPE] Add API to provide geolocation information
https://bugs.webkit.org/show_bug.cgi?id=195940

Reviewed by Michael Catanzaro.

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:

2019-03-20 Youenn Fablet <[email protected]>

Compute quota after network process restart based on default quota and space used
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/PlatformGTK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ set(WebKit2GTK_INSTALLED_HEADERS
${WEBKIT_DIR}/UIProcess/API/gtk/WebKitFindController.h
${WEBKIT_DIR}/UIProcess/API/gtk/WebKitFormSubmissionRequest.h
${WEBKIT_DIR}/UIProcess/API/gtk/WebKitForwardDeclarations.h
${WEBKIT_DIR}/UIProcess/API/gtk/WebKitGeolocationManager.h
${WEBKIT_DIR}/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
${WEBKIT_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
${WEBKIT_DIR}/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.h
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/PlatformWPE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ set(WPE_API_INSTALLED_HEADERS
${WEBKIT_DIR}/UIProcess/API/wpe/WebKitFileChooserRequest.h
${WEBKIT_DIR}/UIProcess/API/wpe/WebKitFindController.h
${WEBKIT_DIR}/UIProcess/API/wpe/WebKitFormSubmissionRequest.h
${WEBKIT_DIR}/UIProcess/API/wpe/WebKitGeolocationManager.h
${WEBKIT_DIR}/UIProcess/API/wpe/WebKitGeolocationPermissionRequest.h
${WEBKIT_DIR}/UIProcess/API/wpe/WebKitHitTestResult.h
${WEBKIT_DIR}/UIProcess/API/wpe/WebKitInstallMissingMediaPluginsPermissionRequest.h
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/SourcesGTK.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ UIProcess/API/glib/WebKitFileChooserRequest.cpp @no-unify
UIProcess/API/glib/WebKitFindController.cpp @no-unify
UIProcess/API/glib/WebKitFormClient.cpp @no-unify
UIProcess/API/glib/WebKitFormSubmissionRequest.cpp @no-unify
UIProcess/API/glib/WebKitGeolocationManager.cpp @no-unify
UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp @no-unify
UIProcess/API/glib/WebKitGeolocationProvider.cpp @no-unify
UIProcess/API/glib/WebKitIconLoadingClient.cpp @no-unify
UIProcess/API/glib/WebKitInjectedBundleClient.cpp @no-unify
UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp @no-unify
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/SourcesWPE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ UIProcess/API/glib/WebKitFileChooserRequest.cpp @no-unify
UIProcess/API/glib/WebKitFindController.cpp @no-unify
UIProcess/API/glib/WebKitFormClient.cpp @no-unify
UIProcess/API/glib/WebKitFormSubmissionRequest.cpp @no-unify
UIProcess/API/glib/WebKitGeolocationManager.cpp @no-unify
UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp @no-unify
UIProcess/API/glib/WebKitGeolocationProvider.cpp @no-unify
UIProcess/API/glib/WebKitInjectedBundleClient.cpp @no-unify
UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp @no-unify
UIProcess/API/glib/WebKitJavascriptResult.cpp @no-unify
Expand Down
Loading

0 comments on commit 389b561

Please sign in to comment.