[Webkit-unassigned] [Bug 67660] [GTK] Add a way to expose well known names for items in the default context menu
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 6 19:46:13 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=67660
--- Comment #2 from Martin Robinson <mrobinson at webkit.org> 2011-09-06 19:46:13 PST ---
(From update of attachment 106450)
View in context: https://bugs.webkit.org/attachment.cgi?id=106450&action=review
I like this patch a lot. I think it has the potential to remove a *ton* of code from Epiphany and other WebKitGTK+ clients. I'm giving the first r+ here, but we need one more to approve the new API. Also, I think this same approach should be used for WebKit2.
> Source/WebKit/gtk/ChangeLog:3
> + Add webkit_context_menu_item_get_action
I think this one is extra...it should be part of the description below.
> Source/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:113
> + g_object_set_data(G_OBJECT(bidiMenuItem.gtkAction()), "gtk-unicode-menu-entry", (gpointer)&bidi_menu_entries[i]);
I'm almost certain you shouldn't need to cast to gpointer here. If you do though, you should use C++ style casts.
> Source/WebKit/gtk/webkit/webkitglobals.cpp:306
> + * can be used to know the items present in the default context menu.
know -> determine
> Source/WebKit/gtk/webkit/webkitglobals.cpp:308
> + * WebKitWebView:context-menu signal:
The second : should be a '.'
> Source/WebKit/gtk/webkit/webkitglobals.cpp:340
> + * GList* items = gtk_container_get_children (GTK_CONTAINER (default_menu));
> + * GList* l;
> + * GtkAction *action;
> + *
> + * for (l = items; l; l = g_list_next (l)) {
> + * GtkMenuItem* item = (GtkMenuItem *)l->data;
> + *
> + * if (GTK_IS_SEPARATOR_MENU_ITEM (item)) {
> + * /* It's separator, do nothing */
> + * continue;
> + * }
> + *
> + * switch (webkit_context_menu_item_get_action (item)) {
> + * case WEBKIT_CONTEXT_MENU_ACTION_NO_ACTION:
> + * /* No action for this item */
> + * break;
> + * /* Don't allow to ope links from context menu */
> + * case WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK:
> + * case WEBKIT_CONTEXT_MENU_ACTION_OPEN_LINK_IN_NEW_WINDOW:
> + * action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (item));
> + * gtk_action_set_sensitive (action, FALSE);
> + * break;
Awesome documentation.
> Source/WebKit/gtk/webkit/webkitglobals.cpp:346
> + * /* Do somethig with submenu */
Hrm. Maybe expand this comment. Can the embedder crawl this menu too?
> Source/WebKit/gtk/webkit/webkitglobals.cpp:362
> +WebKitContextMenuAction webkit_context_menu_item_get_action (GtkMenuItem* item)
Extra space after webkit_context_menu_item_get_action.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list