diff options
author | cookie <cookie@samsung.com> | 2017-10-25 05:48:03 +0000 |
---|---|---|
committer | cookie <cookie@samsung.com> | 2017-10-25 06:02:58 +0000 |
commit | 71e482b4417b7be55246b2f1d326ef8c59c95430 (patch) | |
tree | e59f7fe2890283b9cfe85663e8c3f728a852e036 | |
parent | e3ec7eb49fee09337840753e6e36042f6a52d050 (diff) | |
download | browser-accepted/tizen_4.0_unified.tar.gz browser-accepted/tizen_4.0_unified.tar.bz2 browser-accepted/tizen_4.0_unified.zip |
Location permission issuesubmit/tizen_4.0/20180308.094920accepted/tizen/4.0/unified/20180312.060509tizen_4.0accepted/tizen_4.0_unified
Change-Id: Ica8bbb13f65abccb6e69446fd1715c0828902148
Signed-off-by: cookie <cookie@samsung.com>
-rwxr-xr-x | CMakeLists.txt | 3 | ||||
-rwxr-xr-x | manifest.xml.in.mb | 3 | ||||
-rwxr-xr-x | packaging/org.tizen.browser.spec | 3 | ||||
-rwxr-xr-x | services/WebEngineService/WebView.cpp | 43 | ||||
-rwxr-xr-x | services/WebEngineService/WebView.h | 3 |
5 files changed, 52 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 962cd5f..d23096f 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,6 +83,7 @@ if(TIZEN_BUILD) libssl shortcut libsoup-2.4 + capi-privacy-privilege-manager ) if (${PROFILE} MATCHES "mobile") @@ -97,7 +98,7 @@ if(TIZEN_BUILD) shortcut push capi-network-connection - appcore-common + appcore-common ) endif (${PROFILE} MATCHES "mobile") diff --git a/manifest.xml.in.mb b/manifest.xml.in.mb index 7649155..40acacd 100755 --- a/manifest.xml.in.mb +++ b/manifest.xml.in.mb @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" api-version="3.0" version="@VERSION@" install-location="internal-only"> +<manifest xmlns="http://tizen.org/ns/packages" package="@PACKAGE_NAME@" api-version="4.0" version="@VERSION@" install-location="internal-only"> <label>Internet</label> <icon>org.tizen.browser.png</icon> <description>Web Browser Application</description> @@ -107,5 +107,6 @@ <privilege>http://tizen.org/privilege/network.get</privilege> <privilege>http://tizen.org/privilege/internet</privilege> <privilege>http://tizen.org/privilege/appdir.shareddata</privilege> + <privilege>http://tizen.org/privilege/location</privilege> </privileges> </manifest> diff --git a/packaging/org.tizen.browser.spec b/packaging/org.tizen.browser.spec index 4cdb653..933aa8c 100755 --- a/packaging/org.tizen.browser.spec +++ b/packaging/org.tizen.browser.spec @@ -2,7 +2,7 @@ Name: org.tizen.browser-profile_mobile Summary: Tizen Open Browser -Version: 4.0.6 +Version: 4.0.8 Release: 0 Provides: org.tizen.browser = %{version}-%{release} Conflicts: org.tizen.browser-profile_common @@ -73,6 +73,7 @@ BuildRequires: pkgconfig(dlog) %endif BuildRequires: pkgconfig(libtzplatform-config) +BuildRequires: pkgconfig(capi-privacy-privilege-manager) %define _appdir %{TZ_SYS_RO_APP}/%{alias} %define _bindir %{_appdir}/bin diff --git a/services/WebEngineService/WebView.cpp b/services/WebEngineService/WebView.cpp index 43f92b2..bc88ee6 100755 --- a/services/WebEngineService/WebView.cpp +++ b/services/WebEngineService/WebView.cpp @@ -167,6 +167,8 @@ void WebView::init(bool desktopMode, TabOrigin origin) m_downloadControl = new DownloadControl(); orientationChanged(); + request_application_permission("http://tizen.org/privilege/location"); + BROWSER_LOGD("[%s:%d] Check permissions", __PRETTY_FUNCTION__, __LINE__); auto permissions = *getPermissionsMap(); Eina_List* permList = nullptr; @@ -1581,6 +1583,47 @@ void WebView::__policy_navigation_decide_cb(void *data, Evas_Object * /*obj*/, v ewk_policy_decision_use(policy_decision); } +void WebView::__app_request_response_cb(ppm_call_cause_e cause, ppm_request_result_e result, const char* privilege, void* /*user_data*/) { + BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__); + if (cause == PRIVACY_PRIVILEGE_MANAGER_CALL_CAUSE_ERROR) { + BROWSER_LOGD("ppm_request_permission failed"); + return; + } + + switch (result) { + case PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER: + BROWSER_LOGD("response_cb %s privilege was allowed forever", privilege); + break; + case PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_DENY_FOREVER: + BROWSER_LOGD("response_cb %s privilege was denied forever", privilege); + break; + case PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_DENY_ONCE: + BROWSER_LOGD("response_cb %s privilege was denied", privilege); + break; + } +} + +void WebView:: request_application_permission(const char* privilege) { + BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__); + ppm_check_result_e result; + int ret = ppm_check_permission(privilege, &result); + if (ret != PRIVACY_PRIVILEGE_MANAGER_ERROR_NONE) { + BROWSER_LOGD("ppm_check_permission failed"); + return; + } + + switch (result) { + case PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_ALLOW: + BROWSER_LOGD("request_application()%s privilege was allowed", privilege); + break; + case PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_DENY: + BROWSER_LOGD("request_application()%s privilege was denied", privilege); + break; + case PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_ASK: + ppm_request_permission(privilege, __app_request_response_cb, NULL); + break; + } +} } /* namespace webengine_service */ } /* end of basic_webengine */ } /* end of tizen_browser */ diff --git a/services/WebEngineService/WebView.h b/services/WebEngineService/WebView.h index f1d9678..9c2f290 100755 --- a/services/WebEngineService/WebView.h +++ b/services/WebEngineService/WebView.h @@ -36,6 +36,7 @@ #include <app.h> #include "AbstractRotatable.h" #include <libsoup/soup.h> +#include <privacy-privilege-manager/privacy_privilege_manager.h> enum context_menu_type { TEXT_ONLY = 0, @@ -367,6 +368,8 @@ private: static void __setCertificatePem(void * data, Evas_Object * obj, void * event_info); static void scriptLinkSearchCallback(Evas_Object *o, const char *value, void *data); + static void request_application_permission(const char* privilege); + static void __app_request_response_cb(ppm_call_cause_e cause, ppm_request_result_e result, const char* privilege, void* /*user_data*/); // downloads static void __policy_response_decide_cb(void *data, Evas_Object *obj, void *event_info); |