RESOLVED FIXED Bug 102932
[EFL][WK2] Implement context menu in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=102932
Summary [EFL][WK2] Implement context menu in MiniBrowser
Gyuyoung Kim
Reported 2012-11-21 06:09:31 PST
EFL MiniBrowser needs to support context menu.
Attachments
proposed patch (17.37 KB, patch)
2013-01-21 09:27 PST, Michal Pakula vel Rutka
no flags
minibrowser-only patch (6.12 KB, patch)
2013-01-22 01:06 PST, Michal Pakula vel Rutka
no flags
minibrowser-only patch2 (4.82 KB, patch)
2013-01-22 01:14 PST, Michal Pakula vel Rutka
no flags
fixed patch (4.83 KB, patch)
2013-01-25 04:37 PST, Michal Pakula vel Rutka
eflews.bot: commit-queue-
rebased patch (4.83 KB, patch)
2013-04-16 13:00 PDT, Michal Pakula vel Rutka
no flags
fixes after review (5.22 KB, patch)
2013-04-17 00:43 PDT, Michal Pakula vel Rutka
gyuyoung.kim: review+
fixes (4.86 KB, patch)
2013-04-17 07:19 PDT, Michal Pakula vel Rutka
no flags
Michal Pakula vel Rutka
Comment 1 2013-01-21 09:27:59 PST
Created attachment 183799 [details] proposed patch Elementary context popup after selecting an item, fires a callback which returns data set by user while creating an context popup item. Ewk context menu API when selecting an item, needs two pointers to be passed: a pointer to a menu and to an item. To make implementation easier I have added an API to receive Ewk_Context_Menu_Item's parent menu, so only Ewk_Context_Menu_Item have to be passed to a callback fired when context popup item was selected.
Chris Dumez
Comment 2 2013-01-21 10:49:47 PST
Comment on attachment 183799 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=183799&action=review I think it would be nicer to split WK2 API changes from MiniBrowser changes. > Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item_private.h:66 > + EwkContextMenu* parentMenu() const { return m_parentMenu; } WebKit coding style: The getter should not be const if it returns a non-const pointer. > Tools/MiniBrowser/efl/main.c:94 > + Evas_Object *context_popup; This should probably be initialized to NULL in window_create(). > Tools/MiniBrowser/efl/main.c:910 > + Ewk_Context_Menu_Item *ewk_item = (Ewk_Context_Menu_Item *)data; extra space after = > Tools/MiniBrowser/efl/main.c:1286 > + ewk_settings_continuous_spell_checking_enabled_set(EINA_TRUE); seems unrelated?
Gyuyoung Kim
Comment 3 2013-01-21 22:34:04 PST
Comment on attachment 183799 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=183799&action=review > Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.h:273 > +EAPI Ewk_Context_Menu *ewk_context_menu_item_parent_menu_get(Ewk_Context_Menu_Item *o); Missing *const* keyword in parameter. > Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item_private.h:70 > + explicit EwkContextMenuItem(const WebKit::WebContextMenuItemData&, EwkContextMenu* parentMenu); Please remove explicit keyword.
Michal Pakula vel Rutka
Comment 4 2013-01-22 00:36:35 PST
Comment on attachment 183799 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=183799&action=review >> Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.h:273 >> +EAPI Ewk_Context_Menu *ewk_context_menu_item_parent_menu_get(Ewk_Context_Menu_Item *o); > > Missing *const* keyword in parameter. Added. >> Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item_private.h:66 >> + EwkContextMenu* parentMenu() const { return m_parentMenu; } > > WebKit coding style: The getter should not be const if it returns a non-const pointer. If I have added const to ewk_context_menu_item_parent_menu_get it has to be left here. >> Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item_private.h:70 >> + explicit EwkContextMenuItem(const WebKit::WebContextMenuItemData&, EwkContextMenu* parentMenu); > > Please remove explicit keyword. Removed. >> Tools/MiniBrowser/efl/main.c:94 >> + Evas_Object *context_popup; > > This should probably be initialized to NULL in window_create(). Added. >> Tools/MiniBrowser/efl/main.c:910 >> + Ewk_Context_Menu_Item *ewk_item = (Ewk_Context_Menu_Item *)data; > > extra space after = OK >> Tools/MiniBrowser/efl/main.c:1286 >> + ewk_settings_continuous_spell_checking_enabled_set(EINA_TRUE); > > seems unrelated? I forgot to remove it after tests.
Chris Dumez
Comment 5 2013-01-22 00:43:25 PST
Comment on attachment 183799 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=183799&action=review >>> Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item_private.h:66 >>> + EwkContextMenu* parentMenu() const { return m_parentMenu; } >> >> WebKit coding style: The getter should not be const if it returns a non-const pointer. > > If I have added const to ewk_context_menu_item_parent_menu_get it has to be left here. No, you don't have to leave const here and you should not. Just use const cast in ewk_context_menu_item_parent_menu_get() if needed.
Michal Pakula vel Rutka
Comment 6 2013-01-22 01:06:42 PST
Created attachment 183917 [details] minibrowser-only patch I have split this patch into two: Minibrowser only and ewk context menu API: bug 107510.
Michal Pakula vel Rutka
Comment 7 2013-01-22 01:14:18 PST
Created attachment 183919 [details] minibrowser-only patch2
Kenneth Rohde Christiansen
Comment 8 2013-01-23 15:01:35 PST
Comment on attachment 183917 [details] minibrowser-only patch View in context: https://bugs.webkit.org/attachment.cgi?id=183917&action=review > Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.cpp:153 > EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); > > - return item->parentMenu(); > + return const_cast<Ewk_Context_Menu_Item*>(item)->parentMenu(); > } This code needs review by WebKit2 owner, so could it be in a separate opatch somehow?
Michal Pakula vel Rutka
Comment 9 2013-01-23 23:55:33 PST
(In reply to comment #8) > (From update of attachment 183917 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=183917&action=review > > > Source/WebKit2/UIProcess/API/efl/ewk_context_menu_item.cpp:153 > > EINA_SAFETY_ON_NULL_RETURN_VAL(item, 0); > > > > - return item->parentMenu(); > > + return const_cast<Ewk_Context_Menu_Item*>(item)->parentMenu(); > > } > > This code needs review by WebKit2 owner, so could it be in a separate opatch somehow? I posted this patch accidentally and it is obsolete, please take a look at 183919. This code is moved to bug 107510.
Michal Pakula vel Rutka
Comment 10 2013-01-25 04:37:38 PST
Created attachment 184726 [details] fixed patch added guard in on_context_menu_hide
EFL EWS Bot
Comment 11 2013-02-05 06:00:00 PST
Comment on attachment 184726 [details] fixed patch Attachment 184726 [details] did not pass efl-ews (efl): Output: http://queues.webkit.org/results/16367762
Michal Pakula vel Rutka
Comment 12 2013-04-16 13:00:30 PDT
Created attachment 198392 [details] rebased patch
Gyuyoung Kim
Comment 13 2013-04-16 17:28:31 PDT
Comment on attachment 198392 [details] rebased patch View in context: https://bugs.webkit.org/attachment.cgi?id=198392&action=review > Tools/MiniBrowser/efl/main.c:1107 > + Unneeded line. > Tools/MiniBrowser/efl/main.c:1123 > +fill_context_popup_items(Browser_Window *window, Ewk_Context_Menu *ewk_menu) verb is placed at the end of function in EFL coding style. See also, popup_menu_populate(...) in main.cp > Tools/MiniBrowser/efl/main.c:1157 > + if (!window || !menu) It would be good if you add a log using info(...). > Tools/MiniBrowser/efl/main.c:1178 > + if (!window || !window->context_popup) ditto ?
Michal Pakula vel Rutka
Comment 14 2013-04-17 00:43:52 PDT
Created attachment 198475 [details] fixes after review changed fill_context_popup_items to context_popup_populate, added logs
Gyuyoung Kim
Comment 15 2013-04-17 00:57:00 PDT
Comment on attachment 198475 [details] fixes after review LGTM. But, someone might have a final look.
Chris Dumez
Comment 16 2013-04-17 06:58:12 PDT
Comment on attachment 198475 [details] fixes after review View in context: https://bugs.webkit.org/attachment.cgi?id=198475&action=review > Tools/MiniBrowser/efl/main.c:1389 > + window->context_popup = NULL; Please double check but I don't believe this is needed. If I remember correctly the window memory is calloc'd.
Michal Pakula vel Rutka
Comment 17 2013-04-17 07:19:01 PDT
Chris Dumez
Comment 18 2013-04-17 07:20:18 PDT
Comment on attachment 198506 [details] fixes LGTM.
WebKit Commit Bot
Comment 19 2013-04-17 07:47:53 PDT
Comment on attachment 198506 [details] fixes Clearing flags on attachment: 198506 Committed r148609: <http://trac.webkit.org/changeset/148609>
WebKit Commit Bot
Comment 20 2013-04-17 07:47:57 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.