From 40b53b16f746b43abb00490bf9381c8e5245ddc3 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Fri, 12 Apr 2013 00:25:45 +0900 Subject: [PATCH] apply E_USER_NOT_CONSENTED Change-Id: I764bdd7e2fe6ced6de49c2a29d8525ab53738e6f Signed-off-by: Seongjun Yim --- inc/FWebCtrlAuthenticationChallenge.h | 22 +++++---- inc/FWebCtrlWeb.h | 21 ++++++++ inc/FWebCtrlWebSetting.h | 35 +++++++++++++ src/controls/FWebCtrlAuthenticationChallenge.cpp | 10 ++-- src/controls/FWebCtrlWeb.cpp | 63 ++++++++++++++++-------- src/controls/FWebCtrlWebSetting.cpp | 37 ++++++++++++++ 6 files changed, 153 insertions(+), 35 deletions(-) diff --git a/inc/FWebCtrlAuthenticationChallenge.h b/inc/FWebCtrlAuthenticationChallenge.h index 59ace10..876c63c 100755 --- a/inc/FWebCtrlAuthenticationChallenge.h +++ b/inc/FWebCtrlAuthenticationChallenge.h @@ -59,13 +59,14 @@ public: * * @since 2.0 * - * @privlevel public - * @privilege %http://tizen.org/privilege/web.privacy + * @privlevel public + * @privilege %http://tizen.org/privilege/web.service * - * @param[in] userId The user ID for authentication - * @param[in] password The password for authentication - * @exception E_SUCCESS The method is successful. - * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @param[in] userId The user ID for authentication + * @param[in] password The password for authentication + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void Process(const UserId& userId, const Tizen::Base::String& password); @@ -75,11 +76,12 @@ public: * * @since 2.0 * - * @privlevel public - * @privilege %http://tizen.org/privilege/web.privacy + * @privlevel public + * @privilege %http://tizen.org/privilege/web.service * - * @exception E_SUCCESS The method is successful. - * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void Cancel(void); diff --git a/inc/FWebCtrlWeb.h b/inc/FWebCtrlWeb.h index b3cfb5c..f68276a 100755 --- a/inc/FWebCtrlWeb.h +++ b/inc/FWebCtrlWeb.h @@ -156,6 +156,7 @@ public: * @exception E_SYSTEM The method has failed. * @exception E_INVALID_ARG The specified @c rect is invalid. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result Construct(const Tizen::Graphics::Rectangle& rect); @@ -173,6 +174,7 @@ public: * @exception E_SYSTEM The method has failed. * @exception E_INVALID_ARG The specified @c rect is invalid. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. */ result Construct(const Tizen::Graphics::FloatRectangle& rect); @@ -187,6 +189,7 @@ public: * @param[in] url The resource to load * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void LoadUrl(const Tizen::Base::String& url); @@ -205,6 +208,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_HEADER The header object does not contain any header fields. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result LoadUrl(const Tizen::Base::String& url, const Tizen::Net::Http::HttpHeader& header); @@ -224,6 +228,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_HEADER The header object does not contain any header fields. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result LoadUrlWithPostRequest(const Tizen::Base::String& url, const Tizen::Net::Http::HttpHeader& header, const Tizen::Base::ByteBuffer& body); @@ -242,6 +247,7 @@ public: * @exception E_SUCCESS The method is successful. * @exception E_INVALID_ARG The content buffer is empty @b Since: @b 2.1 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void LoadData(const Tizen::Base::String& baseUrl, const Tizen::Base::ByteBuffer& content, const Tizen::Base::String& mime, const Tizen::Base::String& encoding = "UTF-8"); @@ -256,6 +262,7 @@ public: * * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void StopLoading(void); @@ -270,6 +277,7 @@ public: * * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void Reload(void); @@ -314,6 +322,7 @@ public: * * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void GoBack(void); @@ -328,6 +337,7 @@ public: * * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void GoForward(void); @@ -372,6 +382,7 @@ public: * @param[in] setting The setting to update * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result SetSetting(const Tizen::Web::Controls::WebSetting& setting); @@ -428,6 +439,7 @@ public: * @param[in] scriptCode The JavaScript code as string * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ Tizen::Base::String* EvaluateJavascriptN(const Tizen::Base::String& scriptCode); @@ -496,6 +508,7 @@ public: * @param[in] pLoadingListener The listener receives the events that occurs while loading the data * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetLoadingListener(Tizen::Web::Controls::ILoadingListener* pLoadingListener); @@ -511,6 +524,7 @@ public: * @param[in] pDownLoadListener The listener to receive the data from a network incrementally * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetDownloadListener(Tizen::Web::Controls::IWebDownloadListener* pDownLoadListener); @@ -653,6 +667,7 @@ public: * else @c false * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result SetPrivateBrowsingEnabled(bool enable); @@ -667,6 +682,7 @@ public: * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. * @see CanGoBack() * @see CanGoForward() * @see GoBack() @@ -685,6 +701,7 @@ public: * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result ClearCache(void); @@ -699,6 +716,7 @@ public: * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result ClearCookie(void); @@ -713,6 +731,7 @@ public: * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. */ result ClearFormData(void); @@ -727,6 +746,7 @@ public: * @return An error code * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. */ result ClearLoginFormData(void); @@ -754,6 +774,7 @@ public: * else @c false * @exception E_SUCCESS The method is successful. * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 */ result SetCookieEnabled(bool enable); diff --git a/inc/FWebCtrlWebSetting.h b/inc/FWebCtrlWebSetting.h index 719bedf..eb052cf 100755 --- a/inc/FWebCtrlWebSetting.h +++ b/inc/FWebCtrlWebSetting.h @@ -105,7 +105,14 @@ public: * * @since 2.0 * + * @privlevel public + * @privilege %http://tizen.org/privilege/web.service + * * @param[in] mode A cache mode + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetCacheControl(CacheMode mode); @@ -225,7 +232,14 @@ public: * * @since 2.0 * + * @privlevel public + * @privilege %http://tizen.org/privilege/web.service + * * @param[in] mode A certificate error handling mode + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetCertificateErrorHandlingMode(CertificateErrorHandlingMode mode); @@ -304,8 +318,15 @@ public: * * @since 2.0 * + * @privlevel public + * @privilege %http://tizen.org/privilege/web.service + * * @param[in] enable Set to @c true if the %Web control should support html5 geolocation feature, @n * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. @b Since: @b 2.1 + * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetGeolocationEnabled(bool enable); @@ -325,8 +346,15 @@ public: * * @since 2.1 * + * @privlevel public + * @privilege %http://tizen.org/privilege/web.service + * * @param[in] enable Set to @c true if the %Web control should save form data automatically and supports autocomplete feature, @n * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. + * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetAutoFormDataShowEnabled(bool enable); @@ -346,8 +374,15 @@ public: * * @since 2.1 * + * @privlevel public + * @privilege %http://tizen.org/privilege/web.service + * * @param[in] enable Set to @c true if the %Web control should save login id/password automatically and supports autofill feature, @n * else @c false + * @exception E_SUCCESS The method is successful. + * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method. + * @exception E_USER_NOT_CONSENTED The user blocks an application from calling this method. + * @remarks The specific error code can be accessed using the GetLastResult() method. */ void SetAutoLoginFormFillEnabled(bool enable); diff --git a/src/controls/FWebCtrlAuthenticationChallenge.cpp b/src/controls/FWebCtrlAuthenticationChallenge.cpp index 69fc7df..48d8744 100755 --- a/src/controls/FWebCtrlAuthenticationChallenge.cpp +++ b/src/controls/FWebCtrlAuthenticationChallenge.cpp @@ -58,8 +58,9 @@ AuthenticationChallenge::Process(const UserId& userId, const String& password) ClearLastResult(); result r = E_SUCCESS; - r = _AccessController::CheckUserPrivilege(_PRV_WEB_PRIVACY); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); __pAuthenticationChallengeImpl->Process(userId, password); @@ -75,8 +76,9 @@ AuthenticationChallenge::Cancel(void) ClearLastResult(); result r = E_SUCCESS; - r = _AccessController::CheckUserPrivilege(_PRV_WEB_PRIVACY); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); __pAuthenticationChallengeImpl->Cancel(); } diff --git a/src/controls/FWebCtrlWeb.cpp b/src/controls/FWebCtrlWeb.cpp index a609f08..2fdc91e 100755 --- a/src/controls/FWebCtrlWeb.cpp +++ b/src/controls/FWebCtrlWeb.cpp @@ -63,7 +63,8 @@ Web::Construct(const Rectangle& rect) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); _WebImpl* pWebImpl = _WebImpl::CreateWebImplN(const_cast< Web* >(this), rect); SysTryReturn(NID_WEB_CTRL, pWebImpl, GetLastResult(), GetLastResult(), "[%s] This instance has not been constructed as yet.", GetErrorMessage(GetLastResult())); @@ -84,7 +85,8 @@ Web::Construct(const FloatRectangle& rect) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); _WebImpl* pWebImpl = _WebImpl::CreateWebImplN(const_cast< Web* >(this), rect); SysTryReturn(NID_WEB_CTRL, pWebImpl, GetLastResult(), GetLastResult(), "[%s] This instance has not been constructed as yet.", GetErrorMessage(GetLastResult())); @@ -107,7 +109,8 @@ Web::LoadUrl(const String& url) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); r = pWebImpl->LoadUrl(url); SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -125,7 +128,8 @@ Web::LoadUrl(const String& url, const HttpHeader& header) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); r = pWebImpl->LoadUrl(url, header); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -145,7 +149,8 @@ Web::LoadUrlWithPostRequest(const String& url, const HttpHeader& header, const B result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); SysLog(NID_WEB_CTRL, "The current value of url is %ls, header is %d, body is %ls", url.GetPointer(), &header, (char*) body.GetPointer()); @@ -166,7 +171,8 @@ Web::LoadData(const String& baseUrl, const ByteBuffer& content, const String& mi result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); r = pWebImpl->LoadData(baseUrl, content, mime, encoding); SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -185,7 +191,8 @@ Web::StopLoading(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->StopLoading(); } @@ -201,7 +208,8 @@ Web::Reload(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->Reload(); } @@ -247,7 +255,8 @@ Web::GoBack(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->GoBack(); } @@ -263,7 +272,8 @@ Web::GoForward(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->GoForward(); } @@ -305,7 +315,8 @@ Web::SetSetting(const WebSetting& setting) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); r = pWebImpl->SetSetting(setting); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Failed to set setting.", GetErrorMessage(r)); @@ -364,7 +375,8 @@ Web::EvaluateJavascriptN(const String& scriptCode) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); String* pScript = pWebImpl->EvaluateJavascriptN(scriptCode); SysTryReturn(NID_WEB_CTRL, pScript, null, GetLastResult(), "[%s] Failed to evaluate javascript.", GetErrorMessage(GetLastResult())); @@ -444,7 +456,8 @@ Web::SetLoadingListener(ILoadingListener* pLoadingListener) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->SetLoadingListener(pLoadingListener); @@ -462,7 +475,8 @@ Web::SetDownloadListener(IWebDownloadListener* pDownLoadListener) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->SetDownloadListener(pDownLoadListener); @@ -659,7 +673,8 @@ Web::SetPrivateBrowsingEnabled(bool enable) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method."); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->SetPrivateBrowsingEnabled(enable); @@ -678,7 +693,8 @@ Web::ClearHistory(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->ClearHistory(); @@ -695,7 +711,8 @@ Web::ClearCache(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->ClearCache(); @@ -712,7 +729,8 @@ Web::ClearCookie(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->ClearCookie(); @@ -729,7 +747,8 @@ Web::ClearFormData(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->ClearFormData(); @@ -746,7 +765,8 @@ Web::ClearLoginFormData(void) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s]The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->ClearLoginFormData(); @@ -773,7 +793,8 @@ Web::SetCookieEnabled(bool enable) result r = E_SUCCESS; r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); - SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED)); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); pWebImpl->SetCookieEnabled(enable); diff --git a/src/controls/FWebCtrlWebSetting.cpp b/src/controls/FWebCtrlWebSetting.cpp index 339c8f2..f15733b 100755 --- a/src/controls/FWebCtrlWebSetting.cpp +++ b/src/controls/FWebCtrlWebSetting.cpp @@ -25,10 +25,12 @@ #include #include #include +#include #include "FWebCtrl_WebSettingImpl.h" using namespace Tizen::Base; +using namespace Tizen::Security; using namespace Tizen::Ui::Controls; @@ -81,6 +83,13 @@ WebSetting::SetCacheControl(CacheMode mode) { SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use."); + ClearLastResult(); + result r = E_SUCCESS; + + r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); + __pWebSettingImpl->SetCacheControl(mode); SysLog(NID_WEB_CTRL, "The current value of mode is %d", mode); @@ -201,6 +210,13 @@ WebSetting::SetCertificateErrorHandlingMode(CertificateErrorHandlingMode mode) { SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use."); + ClearLastResult(); + result r = E_SUCCESS; + + r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); + __pWebSettingImpl->SetCertificateErrorHandlingMode(mode); SysLog(NID_WEB_CTRL, "The current value of mode is %d", mode); @@ -281,6 +297,13 @@ WebSetting::SetGeolocationEnabled(bool enable) { SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use."); + ClearLastResult(); + result r = E_SUCCESS; + + r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); + __pWebSettingImpl->SetGeolocationEnabled(enable); SysLog(NID_WEB_CTRL, "The current value of enable is %d", enable); @@ -301,6 +324,13 @@ WebSetting::SetAutoFormDataShowEnabled(bool enable) { SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use."); + ClearLastResult(); + result r = E_SUCCESS; + + r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); + __pWebSettingImpl->SetAutoFormDataShowEnabled(enable); SysLog(NID_WEB_CTRL, "The current value of enable is %d", enable); @@ -321,6 +351,13 @@ WebSetting::SetAutoLoginFormFillEnabled(bool enable) { SysAssertf(__pWebSettingImpl != null, "Not yet constructed. Construct() should be called before use."); + ClearLastResult(); + result r = E_SUCCESS; + + r = _AccessController::CheckUserPrivilege(_PRV_WEB_SERVICE); + r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] The application is not permitted to call this method.", GetErrorMessage(r)); + __pWebSettingImpl->SetAutoLoginFormFillEnabled(enable); SysLog(NID_WEB_CTRL, "The current value of enable is %d", enable); -- 2.7.4