Bug 159630
Summary: | [GTK] Add webkit_context_menu_find API | ||
---|---|---|---|
Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> |
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | bugs-noreply, cgarcia, mcatanzaro |
Priority: | P2 | ||
Version: | Other | ||
Hardware: | PC | ||
OS: | Linux |
Michael Catanzaro
We have this code in ephy-window.c; it should probably be upstreamed into WebKitContextMenu.
/* FIXME: Add webkit_context_menu_find() ? */
static WebKitContextMenuItem *
find_item_in_context_menu (WebKitContextMenu *context_menu,
WebKitContextMenuAction action)
{
GList *items, *iter;
items = webkit_context_menu_get_items (context_menu);
for (iter = items; iter; iter = g_list_next (iter)) {
WebKitContextMenuItem *item = (WebKitContextMenuItem *)iter->data;
if (webkit_context_menu_item_get_stock_action (item) == action)
return g_object_ref (item);
}
return NULL;
}
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Michael Catanzaro
It's written by Carlos Garcia, so we have no copyright issues, but let's have Carlos give final review on this as a formality.
Carlos Garcia Campos
Well, this is very specific to what we need in ephy, as a general purpose API we should probably use a compare function as argument instead of searching by stock action unconditionally. And maybe a flag to indicate whether we want to search for the item in submenus or not