apply E_USER_NOT_CONSENTED
[framework/osp/web.git] / src / controls / FWebCtrlWeb.cpp
index a609f08..2fdc91e 100755 (executable)
@@ -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);