[Title] Add smart callback to provide the popup reply waiting status.
[Problem] Application wants to check whether webkit is waiting for the popup reply or not, but there is no way to check if the application doesn't costomize popups.
[Cause] There is no way to notify the status.
[Solution] Add smart callback 'popup,reply,wait,start' and 'popup,reply,wait,finish' to the ewk view to provide the status.
Change-Id: I691d2566b811abe687aa1777c11693b0c6eedab2
#define ENABLE_TIZEN_WEBKIT2_THEME_SET_INTERNAL 1 /* Ryuan Choi(ryuan.choi@samsung.com) : Set to default theme for WK2/tizen */
#define ENABLE_TIZEN_WEBKIT2_PROXY 1 /* Ryuan Choi(ryuan.choi@samsung.com) : Provide API to set proxy */
#define ENABLE_TIZEN_WEBKIT2_POPUP_INTERNAL 1 /* Ryuan Choi(ryuan.choi@samsung.com) : popup implementation for WK2/tizen internal */
+#define ENABLE_TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS 1 /* Byungwoo Lee(bw80.lee@samsung.com) : Notify popup reply status through the smart callback */
#define ENABLE_TIZEN_SCREEN_ORIENTATION_SUPPORT_INTERNAL ENABLE_TIZEN_SCREEN_ORIENTATION_SUPPORT /* Ryuan choi9ryuan.choi@samsung.com) : temporal implementation for screen orientation lock callback */
#define ENABLE_TIZEN_WEBKIT2_FOCUS_RING 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Focus ring implementation for WK2 */
// UI Client
typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, WKURLRequestRef urlRequest, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void *clientInfo);
//#if OS(TIZEN)
+//#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+typedef void (*WKPageNotifyPopupReplyWaitingStateCallback)(WKPageRef page, bool isWaiting, const void* clientInfo);
+//#endif
typedef bool (*WKPageRunJavaScriptAlertCallback)(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo);
typedef bool (*WKPageRunJavaScriptConfirmCallback)(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo);
typedef bool (*WKPageRunJavaScriptPromptCallback)(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void* clientInfo);
WKPageDecidePolicyForNotificationPermissionRequestCallback decidePolicyForNotificationPermissionRequest;
WKPageUnavailablePluginButtonClickedCallback unavailablePluginButtonClicked;
-//#if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
// Version 2
+//#if ENABLE(TIZEN_INPUT_COLOR_PICKER) // wait for upstream
WKPageShowColorPickerCallback showColorPicker;
WKPageHideColorPickerCallback hideColorPicker;
//#endif
+//#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ WKPageNotifyPopupReplyWaitingStateCallback notifyPopupReplyWaitingState;
+//#endif
};
typedef struct WKPageUIClient WKPageUIClient;
return true;
}
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+void ewkViewNotifyPopupReplyWaitingState(Evas_Object* ewkView, bool isWaiting)
+{
+ if (isWaiting)
+ evas_object_smart_callback_call(ewkView, "popup,reply,wait,start", 0);
+ else
+ evas_object_smart_callback_call(ewkView, "popup,reply,wait,finish", 0);
+}
+#endif
+
bool ewkViewRunJavaScriptAlert(Evas_Object* ewkView, WKStringRef alertText)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
void ewkViewCustomizeContextMenu(Evas_Object* ewkView, Ewk_Context_Menu* menu);
void ewkViewCustomContextMenuItemSelected(Evas_Object* ewkView, Ewk_Context_Menu_Item* item);
uint64_t ewkContextGetDatabaseQuota(Ewk_Context* ewkContext);
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+void ewkViewNotifyPopupReplyWaitingState(Evas_Object* ewkView, bool isWaiting);
+#endif
bool ewkViewRunJavaScriptAlert(Evas_Object* ewkView, WKStringRef alertText);
bool ewkViewRunJavaScriptConfirm(Evas_Object* ewkView, WKStringRef message);
bool ewkViewRunJavaScriptPrompt(Evas_Object* ewkView, WKStringRef message, WKStringRef defaultValue);
process()->responsivenessTimer()->stop();
m_alertReply = reply;
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ m_uiClient.notifyPopupReplyWaitingState(this, true);
+#endif
#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
#endif
process()->responsivenessTimer()->stop();
m_confirmReply = reply;
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ m_uiClient.notifyPopupReplyWaitingState(this, true);
+#endif
#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
#endif
process()->responsivenessTimer()->stop();
m_promptReply = reply;
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ m_uiClient.notifyPopupReplyWaitingState(this, true);
+#endif
#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(true);
#endif
}
#if OS(TIZEN)
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+void WebUIClient::notifyPopupReplyWaitingState(WebPageProxy* page, bool isWaiting)
+{
+ return m_client.notifyPopupReplyWaitingState(toAPI(page), isWaiting, m_client.clientInfo);
+}
+#endif
+
bool WebUIClient::runJavaScriptAlert(WebPageProxy* page, const String& message, WebFrameProxy* frame)
{
#if ENABLE(TIZEN_WEBKIT2_EFL_WTR)
void unfocus(WebPageProxy*);
#if OS(TIZEN)
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ void notifyPopupReplyWaitingState(WebPageProxy*, bool);
+#endif
bool runJavaScriptAlert(WebPageProxy*, const String&, WebFrameProxy*);
bool runJavaScriptConfirm(WebPageProxy*, const String&, WebFrameProxy*);
bool runJavaScriptPrompt(WebPageProxy*, const String&, const String&, WebFrameProxy*);
}
#if OS(TIZEN)
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+void PageUIClientEfl::notifyPopupReplyWaitingState(WKPageRef, bool isWaiting, const void* clientInfo)
+{
+ ewkViewNotifyPopupReplyWaitingState(toPageUIClientEfl(clientInfo)->m_viewImpl->view(), isWaiting);
+}
+#endif
+
bool PageUIClientEfl::runJavaScriptAlert(WKPageRef, WKStringRef alertText, WKFrameRef, const void* clientInfo)
{
return ewkViewRunJavaScriptAlert(toPageUIClientEfl(clientInfo)->m_viewImpl->view(), alertText);
uiClient.hideColorPicker = hideColorPicker;
#endif
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ uiClient.notifyPopupReplyWaitingState = notifyPopupReplyWaitingState;
+#endif
+
#if OS(TIZEN)
#if ENABLE(TIZEN_SUPPORT_BEFORE_UNLOAD_CONFIRM_PANEL)
uiClient.runBeforeUnloadConfirmPanel = runBeforeUnloadConfirmPanel;
static void closePage(WKPageRef, const void*);
static WKPageRef createNewPage(WKPageRef, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*);
#if OS(TIZEN)
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ static void notifyPopupReplyWaitingState(WKPageRef, bool, const void*);
+#endif
static bool runJavaScriptAlert(WKPageRef, WKStringRef, WKFrameRef, const void*);
static bool runJavaScriptConfirm(WKPageRef, WKStringRef, WKFrameRef, const void*);
static bool runJavaScriptPrompt(WKPageRef, WKStringRef, WKStringRef, WKFrameRef, const void*);
m_alertReply->send();
m_alertReply = nullptr;
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ m_uiClient.notifyPopupReplyWaitingState(this, false);
+#endif
#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
#endif
m_confirmReply->send(result);
m_confirmReply = nullptr;
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ m_uiClient.notifyPopupReplyWaitingState(this, false);
+#endif
#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
#endif
m_promptReply->send(result);
m_promptReply = nullptr;
+#if ENABLE(TIZEN_WEBKIT2_NOTIFY_POPUP_REPLY_STATUS)
+ m_uiClient.notifyPopupReplyWaitingState(this, false);
+#endif
#if ENABLE(TIZEN_WEBKIT2_ROTATION_WHILE_JAVASCRIPT_POPUP)
process()->connection()->setForcelySetAllAsyncMessagesToDispatchEvenWhenWaitingForSyncReply(false);
#endif