From: Taeyun An Date: Fri, 28 Jun 2013 09:50:19 +0000 (+0900) Subject: Revert "Add support for HW more/back keys on Javascript popup" X-Git-Tag: submit/tizen_2.2/20130714.131554~92 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa84862e928025dec6c1f9b2300feb03f5d49acc;p=framework%2Fweb%2Fwebkit-efl.git Revert "Add support for HW more/back keys on Javascript popup" This reverts commit 0c058dade4dd8fdf58fac8118de04d25690dcb84. --- diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/JavaScriptPopup.cpp b/Source/WebKit2/UIProcess/API/efl/tizen/JavaScriptPopup.cpp index 929deaf..dab0c59 100755 --- a/Source/WebKit2/UIProcess/API/efl/tizen/JavaScriptPopup.cpp +++ b/Source/WebKit2/UIProcess/API/efl/tizen/JavaScriptPopup.cpp @@ -22,7 +22,6 @@ #include "ewk_view.h" #include -#include #include #include #include @@ -55,15 +54,6 @@ static void alertResponseCallback(void* data, Evas_Object* obj, void* eventInfo) ewk_view_javascript_alert_reply(popup->ewkView()); } -static void alertHwBackKeyCallback(void* data, Evas_Object* obj, void* eventInfo) -{ - JavaScriptPopup* popup = static_cast(data); - if (!popup) - return; - popup->close(); - ewk_view_javascript_alert_reply(popup->ewkView()); -} - bool JavaScriptPopup::setLabelText(const char* message) { if (!message) @@ -87,7 +77,7 @@ bool JavaScriptPopup::setLabelText(const char* message) // Get layout width to set a dynamic label wrap width int layoutWidth; - evas_object_geometry_get(layout, 0, 0, &layoutWidth, 0); + evas_object_geometry_get(layout, NULL, NULL, &layoutWidth, NULL); Evas_Object* label = elm_label_add(layout); elm_label_line_wrap_set(label, ELM_WRAP_MIXED); @@ -99,13 +89,13 @@ bool JavaScriptPopup::setLabelText(const char* message) // Get label height for check the length of the character int labelHeight; - evas_object_geometry_get(label, 0, 0, 0, &labelHeight); + evas_object_geometry_get(label, NULL, NULL, NULL, &labelHeight); // Use the general popup instead of scroll layout when message is a short sentences if (labelHeight < 400) { evas_object_del(m_popup); - Evas_Object* parent = getParentWindow(); + Evas_Object *parent = getParentWindow(); m_popup = elm_popup_add(parent); if (!m_popup) @@ -124,7 +114,7 @@ bool JavaScriptPopup::setLabelText(const char* message) bool JavaScriptPopup::alert(const char* message) { - Evas_Object* parent = getParentWindow(); + Evas_Object *parent = getParentWindow(); if (m_popup) return false; @@ -136,10 +126,8 @@ bool JavaScriptPopup::alert(const char* message) if (!setLabelText(message)) return false; - ea_object_event_callback_add(m_popup, EA_CALLBACK_BACK, alertHwBackKeyCallback, this); - Evas_Object* okButton = elm_button_add(m_popup); - // FIXME: Need to apply i18n for the button label + //FIXME: Need to apply i18n for the button label elm_object_text_set(okButton, "OK"); elm_object_part_content_set(m_popup, "button1", okButton); evas_object_smart_callback_add(okButton, "clicked", alertResponseCallback, this); @@ -167,18 +155,9 @@ static void confirmCancelCallback(void* data, Evas_Object* obj, void* eventInfo) ewk_view_javascript_confirm_reply(popup->ewkView(), false); } -static void confirmHwBackKeyCallback(void* data, Evas_Object* obj, void* eventInfo) -{ - JavaScriptPopup* popup = static_cast(data); - if (!popup) - return; - popup->close(); - ewk_view_javascript_confirm_reply(popup->ewkView(), false); -} - bool JavaScriptPopup::confirm(const char* message) { - Evas_Object* parent = getParentWindow(); + Evas_Object *parent = getParentWindow(); if (m_popup) return false; @@ -190,16 +169,14 @@ bool JavaScriptPopup::confirm(const char* message) if (!setLabelText(message)) return false; - ea_object_event_callback_add(m_popup, EA_CALLBACK_BACK, confirmHwBackKeyCallback, this); - Evas_Object* okButton = elm_button_add(m_popup); - // FIXME: Need to apply i18n for the button label + //FIXME: Need to apply i18n for the button label elm_object_text_set(okButton, "OK"); elm_object_part_content_set(m_popup, "button1", okButton); evas_object_smart_callback_add(okButton, "clicked", confirmOkCallback, this); Evas_Object* cancelButton = elm_button_add(m_popup); - // FIXME: Need to apply i18n for the button label + //FIXME: Need to apply i18n for the button label elm_object_text_set(cancelButton, "Cancel"); elm_object_part_content_set(m_popup, "button2", cancelButton); evas_object_smart_callback_add(cancelButton, "clicked", confirmCancelCallback, this); @@ -238,18 +215,9 @@ static void promptOkCallback(void* data, Evas_Object* obj, void* eventInfo) free(result); } -static void promptHwBackKeyCallback(void* data, Evas_Object* obj, void* eventInfo) -{ - JavaScriptPopup* popup = static_cast(data); - if (!popup) - return; - popup->close(); - ewk_view_javascript_prompt_reply(popup->ewkView(), 0); -} - bool JavaScriptPopup::prompt(const char* message, const char* defaultValue) { - Evas_Object* parent = getParentWindow(); + Evas_Object *parent = getParentWindow(); if (m_popup) return false; @@ -278,7 +246,7 @@ bool JavaScriptPopup::prompt(const char* message, const char* defaultValue) m_entry = elm_entry_add(m_popup); Ecore_IMF_Context* imfContext = static_cast(elm_entry_imf_context_get(m_entry)); - ecore_imf_context_input_panel_event_callback_add(imfContext, ECORE_IMF_INPUT_PANEL_STATE_EVENT, promptEntryChanged, 0); + ecore_imf_context_input_panel_event_callback_add(imfContext, ECORE_IMF_INPUT_PANEL_STATE_EVENT, promptEntryChanged, NULL); elm_entry_scrollable_set(m_entry, EINA_TRUE); elm_object_text_set(m_entry, defaultValue); elm_entry_cursor_end_set(m_entry); @@ -286,16 +254,14 @@ bool JavaScriptPopup::prompt(const char* message, const char* defaultValue) elm_object_part_content_set(layout, "prompt_container", m_entry); elm_object_content_set(m_popup, layout); - ea_object_event_callback_add(m_popup, EA_CALLBACK_BACK, promptHwBackKeyCallback, this); - Evas_Object* okButton = elm_button_add(m_popup); - // FIXME: Need to apply i18n for the button label + //FIXME: Need to apply i18n for the button label elm_object_text_set(okButton, "OK"); elm_object_part_content_set(m_popup, "button1", okButton); evas_object_smart_callback_add(okButton, "clicked", promptOkCallback, this); Evas_Object* cancelButton = elm_button_add(m_popup); - // FIXME: Need to apply i18n for the button label + //FIXME: Need to apply i18n for the button label elm_object_text_set(cancelButton, "Cancel"); elm_object_part_content_set(m_popup, "button2", cancelButton); evas_object_smart_callback_add(cancelButton, "clicked", promptCancelCallback, this); @@ -340,13 +306,13 @@ bool JavaScriptPopup::beforeUnloadConfirmPanel(const char* message) return false; Evas_Object* leaveButton = elm_button_add(m_popup); - // FIXME: Need to apply i18n for the button label + //FIXME: Need to apply i18n for the button label elm_object_text_set(leaveButton, "Leave"); elm_object_part_content_set(m_popup, "button1", leaveButton); evas_object_smart_callback_add(leaveButton, "clicked", beforeUnloadConfirmPanelLeaveCallback, this); Evas_Object* stayButton = elm_button_add(m_popup); - // FIXME: Need to apply i18n for the button label + //FIXME: Need to apply i18n for the button label elm_object_text_set(stayButton, "Stay"); elm_object_part_content_set(m_popup, "button2", stayButton); evas_object_smart_callback_add(stayButton, "clicked", beforeUnloadConfirmPanelStayCallback, this);