listener_(NULL),
view_(view),
fullscreen_(false),
- evas_smart_class_(NULL) {
+ evas_smart_class_(NULL),
+ internal_popup_opened_(false) {
Initialize();
}
WebViewImpl::~WebViewImpl() {
+ if (internal_popup_opened_) {
+ ewk_view_javascript_alert_reply(ewk_view_);
+ }
Deinitialize();
evas_object_del(ewk_view_);
if (evas_smart_class_ != NULL)
InitGeolocationPermissionCallback();
InitAuthenticationCallback();
InitCertificateAllowCallback();
+ InitPopupWaitCallback();
Ewk_Settings* settings = ewk_view_settings_get(ewk_view_);
ewk_settings_scripts_can_open_windows_set(settings, EINA_TRUE);
smart_callbacks_["request,certificate,confirm"] = certi_callback;
}
+void WebViewImpl::InitPopupWaitCallback() {
+ evas_object_smart_callback_add(ewk_view_,
+ "popup,reply,wait,start",
+ [](void* user_data, Evas_Object* /*obj*/, void*) {
+ WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
+ self->internal_popup_opened_ = true;
+ }, this);
+ evas_object_smart_callback_add(ewk_view_,
+ "popup,reply,wait,finish",
+ [](void* user_data, Evas_Object* /*obj*/, void*) {
+ WebViewImpl* self = static_cast<WebViewImpl*>(user_data);
+ self->internal_popup_opened_ = false;
+ }, this);
+}
+
+
std::string WebViewImpl::GetUrl() {
return std::string(ewk_view_url_get(ewk_view_));
void InitGeolocationPermissionCallback();
void InitAuthenticationCallback();
void InitCertificateAllowCallback();
+ void InitPopupWaitCallback();
NativeWindow* window_;
Ewk_Context* context_;
std::string mime_;
Evas_Smart* evas_smart_class_;
Ewk_View_Smart_Class ewk_smart_class_;
+ bool internal_popup_opened_;
};
} // namespace wrt