Changeset 127462 in webkit


Ignore:
Timestamp:
Sep 4, 2012 6:13:08 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Michał Pakuła vel Rutka <Michał Pakuła vel Rutka> 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 <Michał Pakuła vel Rutka> 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 <Michał Pakuła vel Rutka> 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 <Michał Pakuła vel Rutka> 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):

Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r127457 r127462  
     12012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
     2
     3        [EFL] Context menu restore.
     4        https://bugs.webkit.org/show_bug.cgi?id=74179
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
     9        approach, the same as used in WebKit2.
     10
     11        * Source/cmake/OptionsEfl.cmake: Turn on CONTEXT_MENUS flag for EFL port
     12
    1132012-09-04  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r127459 r127462  
     12012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
     2
     3        [EFL] Context menu restore.
     4        https://bugs.webkit.org/show_bug.cgi?id=74179
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
     9        approach, the same as used in WebKit2.
     10
     11        * PlatformEfl.cmake: Removed -DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1
     12
    1132012-09-04  Andrey Adaikin  <aandrey@chromium.org>
    214
  • trunk/Source/WebCore/PlatformEfl.cmake

    r127258 r127462  
    298298ENDIF ()
    299299
    300 ADD_DEFINITIONS(-DWTF_USE_CROSS_PLATFORM_CONTEXT_MENUS=1
    301                 -DDATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}")
     300ADD_DEFINITIONS(-DDATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}")
    302301
    303302IF (ENABLE_WEB_AUDIO)
  • trunk/Source/WebKit/ChangeLog

    r126971 r127462  
     12012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
     2
     3        [EFL] Context menu restore.
     4        https://bugs.webkit.org/show_bug.cgi?id=74179
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
     9        approach, the same as used in WebKit2.
     10
     11        * PlatformEfl.cmake: Added ContextMenuClientEfl.cpp file to sources list.
     12
    1132012-08-29  Ryuan Choi  <ryuan.choi@samsung.com>
    214
  • trunk/Source/WebKit/PlatformEfl.cmake

    r126971 r127462  
    9090    efl/WebCoreSupport/ChromeClientEfl.cpp
    9191    efl/WebCoreSupport/ColorChooserEfl.cpp
     92    efl/WebCoreSupport/ContextMenuClientEfl.cpp
    9293    efl/WebCoreSupport/DeviceOrientationClientEfl.cpp
    9394    efl/WebCoreSupport/DeviceMotionClientEfl.cpp
  • trunk/Source/WebKit/efl/ChangeLog

    r127444 r127462  
     12012-09-04  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
     2
     3        [EFL] Context menu restore.
     4        https://bugs.webkit.org/show_bug.cgi?id=74179
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        Adds context menu support for EFL port using non-CROSS_PLATFORM_CONTEXT_MENUS
     9        approach, the same as used in WebKit2.
     10
     11        * WebCoreSupport/ContextMenuClientEfl.cpp: Added.
     12        (WebCore):
     13        (WebCore::ContextMenuClientEfl::contextMenuDestroyed):
     14        (WebCore::ContextMenuClientEfl::getCustomMenuFromDefaultItems):
     15        (WebCore::ContextMenuClientEfl::contextMenuItemSelected):
     16        (WebCore::ContextMenuClientEfl::downloadURL):
     17        (WebCore::ContextMenuClientEfl::lookUpInDictionary):
     18        (WebCore::ContextMenuClientEfl::speak):
     19        (WebCore::ContextMenuClientEfl::isSpeaking):
     20        (WebCore::ContextMenuClientEfl::stopSpeaking):
     21        (WebCore::ContextMenuClientEfl::searchWithGoogle):
     22        * WebCoreSupport/ContextMenuClientEfl.h: Added.
     23        (WebCore):
     24        (ContextMenuClientEfl):
     25        * ewk/ewk_contextmenu.cpp: Removed ewk_context_menu_customize implementation.
     26        (ewk_context_menu_destroy): Added freeing context menu.
     27        (ewk_context_menu_new): Added filling ewk_contextmenu list.
     28        (ewk_context_menu_item_append):
     29        * ewk/ewk_contextmenu_private.h: Removed ewk_context_menu_customize and changed ewk_context_menu_new definition.
     30        * ewk/ewk_view.cpp:
     31        (_Ewk_View_Private_Data):
     32        (_ewk_view_priv_new):
     33        (_ewk_view_priv_del):
     34        (ewk_view_context_menu_forward_event):
     35
    1362012-09-04  Ryuan Choi  <ryuan.choi@samsung.com>
    237
  • trunk/Source/WebKit/efl/ewk/ewk_contextmenu.cpp

    r109205 r127462  
    2525#include "ContextMenuController.h"
    2626#include "ContextMenuItem.h"
    27 #include "ewk_private.h"
     27#include "ewk_contextmenu_private.h"
    2828#include <Eina.h>
    2929#include <eina_safety_checks.h>
     
    8585    EINA_SAFETY_ON_NULL_RETURN_VAL(menu->controller, false);
    8686    menu->controller->clearContextMenu();
     87    ewk_context_menu_free(menu);
    8788    return true;
    8889#else
     
    218219 * @note emits a signal "contextmenu,new"
    219220 */
    220 Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller)
     221Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller, WebCore::ContextMenu* coreMenu)
    221222{
    222223    Ewk_Context_Menu* menu;
     
    232233    evas_object_smart_callback_call(menu->view, "contextmenu,new", menu);
    233234
     235    const Vector<WebCore::ContextMenuItem>* itemsList = coreMenu->platformDescription();
     236    for (Vector<WebCore::ContextMenuItem>::const_iterator iter = itemsList->begin(); iter != itemsList->end(); ++iter)
     237        ewk_context_menu_item_append(menu, *iter);
     238
    234239    return menu;
    235240}
     
    267272 * @see ewk_context_menu_item_new
    268273 */
    269 void ewk_context_menu_item_append(Ewk_Context_Menu* menu, WebCore::ContextMenuItem& core)
     274void ewk_context_menu_item_append(Ewk_Context_Menu* menu, const WebCore::ContextMenuItem& core)
    270275{
    271276    Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type());
     
    284289 * @internal
    285290 *
    286  * Emits a signal with the items of the context menu.
     291 * Emits a signal "contextmenu,show"
    287292 *
    288293 * @param menu the context menu object
    289  * @return the same context menu object that was given through parameter
    290  *
    291  * @note emits a signal "contextmenu,customize"
    292  *
    293  * @see ewk_context_menu_item_list_get
    294  */
    295 Ewk_Context_Menu* ewk_context_menu_customize(Ewk_Context_Menu* menu)
    296 {
    297     EINA_SAFETY_ON_NULL_RETURN_VAL(menu, 0);
    298 
    299     evas_object_smart_callback_call(menu->view, "contextmenu,customize", menu->items);
    300     return menu;
    301 }
    302 
    303 /**
    304  * @internal
    305  *
    306  * Emits a signal "contextmenu,show"
    307  *
    308  * @param menu the context menu object
    309294 */
    310295void ewk_context_menu_show(Ewk_Context_Menu* menu)
  • trunk/Source/WebKit/efl/ewk/ewk_contextmenu_private.h

    r117046 r127462  
    2222#define ewk_contextmenu_private_h
    2323
     24#include "ewk_contextmenu.h"
     25
    2426// forward declarations
    2527namespace WebCore {
     
    2931
    3032#if ENABLE(CONTEXT_MENUS)
    31 Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller);
     33Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller, WebCore::ContextMenu* coreMenu);
    3234bool ewk_context_menu_free(Ewk_Context_Menu* menu);
    33 void ewk_context_menu_item_append(Ewk_Context_Menu* menu, WebCore::ContextMenuItem& core);
    34 Ewk_Context_Menu* ewk_context_menu_customize(Ewk_Context_Menu* menu);
     35void ewk_context_menu_item_append(Ewk_Context_Menu* menu, const WebCore::ContextMenuItem& core);
    3536void ewk_context_menu_show(Ewk_Context_Menu* menu);
    3637#endif
    3738
    38 #endif // ewk_context_manu_private_h
     39#endif // ewk_context_menu_private_h
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r127024 r127462  
    2828#include "Chrome.h"
    2929#include "ChromeClientEfl.h"
     30#include "ContextMenuClientEfl.h"
    3031#include "ContextMenuController.h"
    3132#include "DocumentLoader.h"
     
    5859#include "Settings.h"
    5960#include "c_instance.h"
     61#include "ewk_contextmenu_private.h"
    6062#include "ewk_frame.h"
    6163#include "ewk_frame_private.h"
     
    361363    bool isUsingEcoreX;
    362364#endif
     365    Ewk_Context_Menu* contextMenu;
    363366};
    364367
     
    742745    WebCore::Page::PageClients pageClients;
    743746    pageClients.chromeClient = new WebCore::ChromeClientEfl(smartData->self);
     747    pageClients.contextMenuClient = new WebCore::ContextMenuClientEfl;
    744748    pageClients.editorClient = new WebCore::EditorClientEfl(smartData->self);
    745749    pageClients.dragClient = new WebCore::DragClientEfl;
     
    892896#endif
    893897
     898    priv->contextMenu = 0;
     899
    894900    return priv;
    895901}
     
    924930    if (priv->cursorObject)
    925931        evas_object_del(priv->cursorObject);
     932
     933    if (priv->contextMenu)
     934        ewk_context_menu_free(priv->contextMenu);
    926935
    927936    delete priv;
     
    16251634
    16261635    priv->page->contextMenuController()->clearContextMenu();
     1636    if (priv->contextMenu)
     1637        ewk_context_menu_free(priv->contextMenu);
     1638
    16271639    WebCore::Frame* mainFrame = priv->page->mainFrame();
    16281640    Evas_Coord x, y;
     
    16361648    }
    16371649
    1638     if (mainFrame->eventHandler()->sendContextMenuEvent(event))
     1650    if (!mainFrame->eventHandler()->sendContextMenuEvent(event))
    16391651        return false;
    16401652
     
    16461658        return mouse_press_handled;
    16471659    }
     1660
     1661    priv->contextMenu = ewk_context_menu_new(ewkView, priv->page->contextMenuController(), coreMenu);
     1662    if (!priv->contextMenu)
     1663        return false;
     1664
     1665    ewk_context_menu_show(priv->contextMenu);
    16481666
    16491667    return true;
  • trunk/Source/cmake/OptionsEfl.cmake

    r127419 r127462  
    2727ADD_DEFINITIONS(-DWTF_USE_SOUP=1)
    2828
    29 ADD_DEFINITIONS(-DENABLE_CONTEXT_MENUS=0)
     29ADD_DEFINITIONS(-DENABLE_CONTEXT_MENUS=1)
    3030
    3131SET(WTF_USE_PTHREADS 1)
Note: See TracChangeset for help on using the changeset viewer.