[webkit-reviews] review granted: [Bug 80600] [GTK] Add input methods submenu item to the default context menu for editable content : [Attachment 130830] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jun 8 16:28:50 PDT 2012
Martin Robinson <mrobinson at webkit.org> has granted Carlos Garcia Campos
<cgarcia at igalia.com>'s request for review:
Bug 80600: [GTK] Add input methods submenu item to the default context menu for
editable content
https://bugs.webkit.org/show_bug.cgi?id=80600
Attachment 130830: Patch
https://bugs.webkit.org/attachment.cgi?id=130830&action=review
------- Additional Comments from Martin Robinson <mrobinson at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=130830&action=review
Looks good, though I think some of your private methods could be renamed
slightly to make things clearer.
> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:839
> + GtkSettings* settings = webView ?
gtk_widget_get_settings(GTK_WIDGET(webView)) : gtk_settings_get_default();
Hrm. In what situations can webView be NULL? Perhaps this should just be
ASSERT(webView).
> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:855
> + if (!imContext)
> + return;
ASSERT(imContext) perhaps?
> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:867
> +void webkitWebViewContextMenu(WebKitWebView* webView, WKArrayRef
wkProposedMenu, WKHitTestResultRef wkHitTestResult)
I think I would prefer this to be named something with a verb like
webkitWebViewPopulateContextMenu.
> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:588
> +void webkitWebViewBaseSetActiveContextMenu(WebKitWebViewBase*
webkitWebViewBase, WebContextMenuProxyGtk* contextMenuProxy)
> +{
> + webkitWebViewBase->priv->activeContextMenu = contextMenuProxy;
> +}
> +
> +WebContextMenuProxyGtk*
webkitWebViewBaseGetActiveContextMenu(WebKitWebViewBase* webkitWebViewBase)
> +{
> + return webkitWebViewBase->priv->activeContextMenu;
> +}
I think this code might be a lot clearer if these methods were named
webkitWebViewBaseSetActiveContextMenuProxy and
webkitWebViewBaseGetActiveContextMenu, while the private member could be named
activeContextMenuProxy. I was a bit confused for a while because the
activeContextMenu is used to build new menus.
> Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp:76
> + ContextMenuItem menuitem = items.at(i).core();
> + append(menuitem);
This could probably be one line.
More information about the webkit-reviews
mailing list