.: [EFL] Context menu restore.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2012 13:13:08 +0000 (13:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2012 13:13:08 +0000 (13:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=74179

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2012-09-04
Reviewed by Gyuyoung Kim.

Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
approach, the same as used in WebKit2.

* Source/cmake/OptionsEfl.cmake: Turn on CONTEXT_MENUS flag for EFL port

Source/WebCore: [EFL] Context menu restore.
https://bugs.webkit.org/show_bug.cgi?id=74179

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2012-09-04
Reviewed by Gyuyoung Kim.

Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
approach, the same as used in WebKit2.

* PlatformEfl.cmake: Removed -DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1

Source/WebKit: [EFL] Context menu restore.
https://bugs.webkit.org/show_bug.cgi?id=74179

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2012-09-04
Reviewed by Gyuyoung Kim.

Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
approach, the same as used in WebKit2.

* PlatformEfl.cmake: Added ContextMenuClientEfl.cpp file to sources list.

Source/WebKit/efl: [EFL] Context menu restore.
https://bugs.webkit.org/show_bug.cgi?id=74179

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2012-09-04
Reviewed by Gyuyoung Kim.

Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
approach, the same as used in WebKit2.

* WebCoreSupport/ContextMenuClientEfl.cpp: Added.
(WebCore):
(WebCore::ContextMenuClientEfl::contextMenuDestroyed):
(WebCore::ContextMenuClientEfl::getCustomMenuFromDefaultItems):
(WebCore::ContextMenuClientEfl::contextMenuItemSelected):
(WebCore::ContextMenuClientEfl::downloadURL):
(WebCore::ContextMenuClientEfl::lookUpInDictionary):
(WebCore::ContextMenuClientEfl::speak):
(WebCore::ContextMenuClientEfl::isSpeaking):
(WebCore::ContextMenuClientEfl::stopSpeaking):
(WebCore::ContextMenuClientEfl::searchWithGoogle):
* WebCoreSupport/ContextMenuClientEfl.h: Added.
(WebCore):
(ContextMenuClientEfl):
* ewk/ewk_contextmenu.cpp: Removed ewk_context_menu_customize implementation.
(ewk_context_menu_destroy): Added freeing context menu.
(ewk_context_menu_new): Added filling ewk_contextmenu list.
(ewk_context_menu_item_append):
* ewk/ewk_contextmenu_private.h: Removed ewk_context_menu_customize and changed ewk_context_menu_new definition.
* ewk/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_ewk_view_priv_new):
(_ewk_view_priv_del):
(ewk_view_context_menu_forward_event):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127462 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebKit/ChangeLog
Source/WebKit/PlatformEfl.cmake
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp [new file with mode: 0644]
Source/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h [new file with mode: 0644]
Source/WebKit/efl/ewk/ewk_contextmenu.cpp
Source/WebKit/efl/ewk/ewk_contextmenu_private.h
Source/WebKit/efl/ewk/ewk_view.cpp
Source/cmake/OptionsEfl.cmake

index 5086422..1171c39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
+
+        [EFL] Context menu restore.
+        https://bugs.webkit.org/show_bug.cgi?id=74179
+
+        Reviewed by Gyuyoung Kim.
+
+        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
+        approach, the same as used in WebKit2.
+
+        * Source/cmake/OptionsEfl.cmake: Turn on CONTEXT_MENUS flag for EFL port
+
 2012-09-04  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
 
         Allow child-frame content in hit-tests.
index 40719ea..db4ccdc 100644 (file)
@@ -1,3 +1,15 @@
+2012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
+
+        [EFL] Context menu restore.
+        https://bugs.webkit.org/show_bug.cgi?id=74179
+
+        Reviewed by Gyuyoung Kim.
+
+        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
+        approach, the same as used in WebKit2.
+
+        * PlatformEfl.cmake: Removed -DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1
+
 2012-09-04  Andrey Adaikin  <aandrey@chromium.org>
 
         Web Inspector: [WebGL] Bugfix: wrong texture binding target in replay for 3D textures
index 454eee8..b9af98e 100644 (file)
@@ -297,8 +297,7 @@ IF (WTF_USE_3D_GRAPHICS)
   )
 ENDIF ()
 
-ADD_DEFINITIONS(-DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1
-                -DDATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}")
+ADD_DEFINITIONS(-DDATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}")
 
 IF (ENABLE_WEB_AUDIO)
   LIST(APPEND WebCore_INCLUDE_DIRECTORIES
index cdabb1d..dd8236a 100644 (file)
@@ -1,3 +1,15 @@
+2012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
+
+        [EFL] Context menu restore.
+        https://bugs.webkit.org/show_bug.cgi?id=74179
+
+        Reviewed by Gyuyoung Kim.
+
+        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
+        approach, the same as used in WebKit2.
+
+        * PlatformEfl.cmake: Added ContextMenuClientEfl.cpp file to sources list.
+
 2012-08-29  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Move several files to remove webkit1 dependency from WebCore.
index d8d2fb5..84f0240 100644 (file)
@@ -89,6 +89,7 @@ LIST(APPEND WebKit_SOURCES
     efl/WebCoreSupport/BatteryClientEfl.cpp
     efl/WebCoreSupport/ChromeClientEfl.cpp
     efl/WebCoreSupport/ColorChooserEfl.cpp
+    efl/WebCoreSupport/ContextMenuClientEfl.cpp
     efl/WebCoreSupport/DeviceOrientationClientEfl.cpp
     efl/WebCoreSupport/DeviceMotionClientEfl.cpp
     efl/WebCoreSupport/DragClientEfl.cpp
index 86c4b2f..354476e 100644 (file)
@@ -1,3 +1,38 @@
+2012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
+
+        [EFL] Context menu restore. 
+        https://bugs.webkit.org/show_bug.cgi?id=74179
+
+        Reviewed by Gyuyoung Kim.
+
+        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
+        approach, the same as used in WebKit2.
+
+        * WebCoreSupport/ContextMenuClientEfl.cpp: Added.
+        (WebCore):
+        (WebCore::ContextMenuClientEfl::contextMenuDestroyed):
+        (WebCore::ContextMenuClientEfl::getCustomMenuFromDefaultItems):
+        (WebCore::ContextMenuClientEfl::contextMenuItemSelected):
+        (WebCore::ContextMenuClientEfl::downloadURL):
+        (WebCore::ContextMenuClientEfl::lookUpInDictionary):
+        (WebCore::ContextMenuClientEfl::speak):
+        (WebCore::ContextMenuClientEfl::isSpeaking):
+        (WebCore::ContextMenuClientEfl::stopSpeaking):
+        (WebCore::ContextMenuClientEfl::searchWithGoogle):
+        * WebCoreSupport/ContextMenuClientEfl.h: Added.
+        (WebCore):
+        (ContextMenuClientEfl):
+        * ewk/ewk_contextmenu.cpp: Removed ewk_context_menu_customize implementation.
+        (ewk_context_menu_destroy): Added freeing context menu. 
+        (ewk_context_menu_new): Added filling ewk_contextmenu list.
+        (ewk_context_menu_item_append):
+        * ewk/ewk_contextmenu_private.h: Removed ewk_context_menu_customize and changed ewk_context_menu_new definition.
+        * ewk/ewk_view.cpp:
+        (_Ewk_View_Private_Data):
+        (_ewk_view_priv_new):
+        (_ewk_view_priv_del):
+        (ewk_view_context_menu_forward_event):
+
 2012-09-04  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Drop default theme concept
diff --git a/Source/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp
new file mode 100644 (file)
index 0000000..5f56e31
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2008 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2009 Igalia S.L.
+ * Copyright (C) 2010 ProFUSION embedded systems
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ContextMenuClientEfl.h"
+
+#include "ContextMenu.h"
+#include "HitTestResult.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+void ContextMenuClientEfl::contextMenuDestroyed()
+{
+    delete this;
+}
+
+PlatformMenuDescription ContextMenuClientEfl::getCustomMenuFromDefaultItems(ContextMenu* menu)
+{
+    // warning: this transfers the ownership to the caller
+    return menu->releasePlatformDescription();
+}
+
+void ContextMenuClientEfl::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::downloadURL(const KURL&)
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::lookUpInDictionary(Frame*)
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::speak(const String&)
+{
+    notImplemented();
+}
+
+bool ContextMenuClientEfl::isSpeaking()
+{
+    notImplemented();
+    return false;
+}
+
+void ContextMenuClientEfl::stopSpeaking()
+{
+    notImplemented();
+}
+
+void ContextMenuClientEfl::searchWithGoogle(const Frame*)
+{
+    notImplemented();
+}
+
+}
diff --git a/Source/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h b/Source/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h
new file mode 100644 (file)
index 0000000..39a881d
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2009 Igalia S.L.
+ * Copyright (C) 2010 ProFUSION embedded systems
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ContextMenuClientEfl_h
+#define ContextMenuClientEfl_h
+
+#include "ContextMenuClient.h"
+
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+class ContextMenu;
+
+class ContextMenuClientEfl : public ContextMenuClient {
+public:
+    virtual void contextMenuDestroyed();
+
+    virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*);
+    virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*);
+
+    virtual void downloadURL(const KURL&);
+    virtual void lookUpInDictionary(Frame*);
+    virtual void speak(const String&);
+    virtual bool isSpeaking();
+    virtual void stopSpeaking();
+    virtual void searchWithGoogle(const Frame*);
+};
+}
+
+#endif
index 6dfe909..e792c6d 100644 (file)
@@ -24,7 +24,7 @@
 #include "ContextMenu.h"
 #include "ContextMenuController.h"
 #include "ContextMenuItem.h"
-#include "ewk_private.h"
+#include "ewk_contextmenu_private.h"
 #include <Eina.h>
 #include <eina_safety_checks.h>
 #include <wtf/text/CString.h>
@@ -84,6 +84,7 @@ Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu)
     EINA_SAFETY_ON_NULL_RETURN_VAL(menu, false);
     EINA_SAFETY_ON_NULL_RETURN_VAL(menu->controller, false);
     menu->controller->clearContextMenu();
+    ewk_context_menu_free(menu);
     return true;
 #else
     return false;
@@ -217,7 +218,7 @@ Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item* item, Eina_Bo
  *
  * @note emits a signal "contextmenu,new"
  */
-Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller)
+Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller, WebCore::ContextMenu* coreMenu)
 {
     Ewk_Context_Menu* menu;
     EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0);
@@ -231,6 +232,10 @@ Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuCo
     menu->items = 0;
     evas_object_smart_callback_call(menu->view, "contextmenu,new", menu);
 
+    const Vector<WebCore::ContextMenuItem>* itemsList = coreMenu->platformDescription();
+    for (Vector<WebCore::ContextMenuItem>::const_iterator iter = itemsList->begin(); iter != itemsList->end(); ++iter)
+        ewk_context_menu_item_append(menu, *iter);
+
     return menu;
 }
 
@@ -266,7 +271,7 @@ bool ewk_context_menu_free(Ewk_Context_Menu* menu)
  *
  * @see ewk_context_menu_item_new
  */
-void ewk_context_menu_item_append(Ewk_Context_Menu* menu, WebCore::ContextMenuItem& core)
+void ewk_context_menu_item_append(Ewk_Context_Menu* menu, const WebCore::ContextMenuItem& core)
 {
     Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type());
     Ewk_Context_Menu_Action action = static_cast<Ewk_Context_Menu_Action>(core.action());
@@ -283,26 +288,6 @@ void ewk_context_menu_item_append(Ewk_Context_Menu* menu, WebCore::ContextMenuIt
 /**
  * @internal
  *
- * Emits a signal with the items of the context menu.
- *
- * @param menu the context menu object
- * @return the same context menu object that was given through parameter
- *
- * @note emits a signal "contextmenu,customize"
- *
- * @see ewk_context_menu_item_list_get
- */
-Ewk_Context_Menu* ewk_context_menu_customize(Ewk_Context_Menu* menu)
-{
-    EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0);
-
-    evas_object_smart_callback_call(menu->view, "contextmenu,customize", menu->items);
-    return menu;
-}
-
-/**
- * @internal
- *
  * Emits a signal "contextmenu,show"
  *
  * @param menu the context menu object
index ce1f3a8..95dcdaa 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef ewk_contextmenu_private_h
 #define ewk_contextmenu_private_h
 
+#include "ewk_contextmenu.h"
+
 // forward declarations
 namespace WebCore {
 struct ContextMenu;
@@ -28,11 +30,10 @@ struct ContextMenuItem;
 }
 
 #if ENABLE(CONTEXT_MENUS)
-Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller);
+Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller, WebCore::ContextMenu* coreMenu);
 bool ewk_context_menu_free(Ewk_Context_Menu* menu);
-void ewk_context_menu_item_append(Ewk_Context_Menu* menu, WebCore::ContextMenuItem& core);
-Ewk_Context_Menu* ewk_context_menu_customize(Ewk_Context_Menu* menu);
+void ewk_context_menu_item_append(Ewk_Context_Menu* menu, const WebCore::ContextMenuItem& core);
 void ewk_context_menu_show(Ewk_Context_Menu* menu);
 #endif
 
-#endif // ewk_context_manu_private_h
+#endif // ewk_context_menu_private_h
index ef609cc..4949aac 100644 (file)
@@ -27,6 +27,7 @@
 #include "Bridge.h"
 #include "Chrome.h"
 #include "ChromeClientEfl.h"
+#include "ContextMenuClientEfl.h"
 #include "ContextMenuController.h"
 #include "DocumentLoader.h"
 #include "DragClientEfl.h"
@@ -57,6 +58,7 @@
 #include "ResourceHandle.h"
 #include "Settings.h"
 #include "c_instance.h"
+#include "ewk_contextmenu_private.h"
 #include "ewk_frame.h"
 #include "ewk_frame_private.h"
 #include "ewk_history_private.h"
@@ -360,6 +362,7 @@ struct _Ewk_View_Private_Data {
 #ifdef HAVE_ECORE_X
     bool isUsingEcoreX;
 #endif
+    Ewk_Context_Menu* contextMenu;
 };
 
 #ifndef EWK_TYPE_CHECK
@@ -741,6 +744,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
 
     WebCore::Page::PageClients pageClients;
     pageClients.chromeClient = new WebCore::ChromeClientEfl(smartData->self);
+    pageClients.contextMenuClient = new WebCore::ContextMenuClientEfl;
     pageClients.editorClient = new WebCore::EditorClientEfl(smartData->self);
     pageClients.dragClient = new WebCore::DragClientEfl;
 #if ENABLE(INSPECTOR)
@@ -891,6 +895,8 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
     priv->isUsingEcoreX = WebCore::isUsingEcoreX(smartData->base.evas);
 #endif
 
+    priv->contextMenu = 0;
+
     return priv;
 }
 
@@ -924,6 +930,9 @@ static void _ewk_view_priv_del(Ewk_View_Private_Data* priv)
     if (priv->cursorObject)
         evas_object_del(priv->cursorObject);
 
+    if (priv->contextMenu)
+        ewk_context_menu_free(priv->contextMenu);
+
     delete priv;
 }
 
@@ -1624,6 +1633,9 @@ Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* ewkView, const Evas_E
     Eina_Bool mouse_press_handled = false;
 
     priv->page->contextMenuController()->clearContextMenu();
+    if (priv->contextMenu)
+        ewk_context_menu_free(priv->contextMenu);
+
     WebCore::Frame* mainFrame = priv->page->mainFrame();
     Evas_Coord x, y;
     evas_object_geometry_get(smartData->self, &x, &y, 0, 0);
@@ -1635,7 +1647,7 @@ Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* ewkView, const Evas_E
             mainFrame->eventHandler()->handleMousePressEvent(event);
     }
 
-    if (mainFrame->eventHandler()->sendContextMenuEvent(event))
+    if (!mainFrame->eventHandler()->sendContextMenuEvent(event))
         return false;
 
     WebCore::ContextMenu* coreMenu =
@@ -1646,6 +1658,12 @@ Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* ewkView, const Evas_E
         return mouse_press_handled;
     }
 
+    priv->contextMenu = ewk_context_menu_new(ewkView, priv->page->contextMenuController(), coreMenu);
+    if (!priv->contextMenu)
+        return false;
+
+    ewk_context_menu_show(priv->contextMenu);
+
     return true;
 #else
     return false;
index 633d1b9..62fd482 100644 (file)
@@ -26,7 +26,7 @@ SET(ENABLE_GLIB_SUPPORT ON)
 SET(WTF_USE_SOUP 1)
 ADD_DEFINITIONS(-DWTF_USE_SOUP=1)
 
-ADD_DEFINITIONS(-DENABLE_CONTEXT_MENUS=0)
+ADD_DEFINITIONS(-DENABLE_CONTEXT_MENUS=1)
 
 SET(WTF_USE_PTHREADS 1)
 ADD_DEFINITIONS(-DWTF_USE_PTHREADS=1)