#include <wrt-commons/custom-handler-dao-ro/CustomHandlerDatabase.h>
#include <wrt-commons/custom-handler-dao-ro/custom_handler_dao_read_only.h>
#include <wrt-commons/custom-handler-dao-rw/custom_handler_dao.h>
+#include <popup-runner/PopupInvoker.h>
#include <appsvc/appsvc.h>
const char CONTENT_HANDLER_ASK_MSG[] = "Add content?";
const char CONTENT_HANDLER_ASK_TITLE[] = "Add content";
const char CONTENT_HANDLER_AKS_REMEMBER[] = "Remember dicision";
+const char * const CERTIFICATE_CONFIRM_REQUEST_ASK_TITLE =
+ "Certification Info";
+const char * const CERTIFICATE_CONFIRM_REQUEST_ASK_BODY =
+ "This site's security certificate is not trusted! Do you acess this site?";
} // anonymous namespace
std::map<const std::string, const Evas_Smart_Cb> ViewLogic::m_ewkCallbacksMap =
{"protocolhandler,unregistration,requested", &ViewLogic::protocolHandlerUnregistrationCallback},
{"contenthandler,registration,requested", &ViewLogic::contentHandlerRegistrationCallback},
{"contenthandler,isregistered", &ViewLogic::contentHandlerIsRegisteredCallback},
- {"contenthandler,unregistration,requested", &ViewLogic::contentHandlerUnregistrationCallback}
+ {"contenthandler,unregistration,requested", &ViewLogic::contentHandlerUnregistrationCallback},
+ {"request,certificate,confirm", &ViewLogic::certificateConfirmRequestCallback}
};
ViewLogic::ViewLogic():
vibrationCancelCallback,
this);
+ ewk_context_certificate_file_set(m_ewkContext,
+ "/opt/usr/share/certs/ca-certificate.crt");
+
// set to member value
m_ewkContext = newEwkContext;
}
eventInfo);
}
+void ViewLogic::certificateConfirmRequestCallback(
+ void* data,
+ Evas_Object* /*obj*/,
+ void* eventInfo)
+{
+ LogDebug("certificateConfirmRequestCallback called");
+
+ Assert(data);
+ ViewLogic* This = static_cast<ViewLogic*>(data);
+ Assert(eventInfo);
+ Ewk_Certificate_Policy_Decision* certificatePolicyDecision =
+ static_cast<Ewk_Certificate_Policy_Decision*>(eventInfo);
+
+ bool status = This->askUserForCertificateConfirm();
+ if(!status) {
+ ewk_certificate_policy_decision_allowed_set(
+ certificatePolicyDecision,
+ EINA_FALSE);
+ }
+ else {
+ ewk_certificate_policy_decision_allowed_set(
+ certificatePolicyDecision,
+ EINA_TRUE);
+ }
+}
+
+bool ViewLogic::askUserForCertificateConfirm()
+{
+ return Wrt::Popup::PopupInvoker().askYesNo(
+ CERTIFICATE_CONFIRM_REQUEST_ASK_TITLE,
+ CERTIFICATE_CONFIRM_REQUEST_ASK_BODY);
+}
+
void ViewLogic::didRecieveMessageFromInjectedBundle(
const char* name,
const char* /*body*/)