<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[218445] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/218445">218445</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2017-06-17 00:21:03 -0700 (Sat, 17 Jun 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
https://bugs.webkit.org/show_bug.cgi?id=173469

Reviewed by Michael Catanzaro.

Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for
backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port.

* PlatformGTK.cmake:
* Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp.
(WebKit::gtkStockIDFromContextMenuAction):
(WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib):
(WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib):
(WebKit::WebContextMenuItemGlib::buildActionName):
(WebKit::WebContextMenuItemGlib::createActionIfNeeded):
* Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h.
* UIProcess/API/gtk/WebKitContextMenu.cpp:
(webkitContextMenuPopulate):
* UIProcess/API/gtk/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetForContextMenuItem):
* UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
(webkitContextMenuItemCreate):
(webkitContextMenuItemToWebContextMenuItemGlib):
(webkit_context_menu_item_new):
(webkit_context_menu_item_new_from_gaction):
(webkit_context_menu_item_new_from_stock_action):
(webkit_context_menu_item_new_from_stock_action_with_label):
(webkit_context_menu_item_new_with_submenu):
(webkit_context_menu_item_new_separator):
* UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewPopulateContextMenu):
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::buildMenu):
(WebKit::WebContextMenuProxyGtk::populate):
* UIProcess/gtk/WebContextMenuProxyGtk.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenucpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuActionscpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuActionsPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuItemcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuItemPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuPrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebContextMenuProxyGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebContextMenuProxyGtkh">trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedglibWebContextMenuItemGlibcpp">trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedglibWebContextMenuItemGlibh">trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedgtkWebContextMenuItemGtkcpp">trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedgtkWebContextMenuItemGtkh">trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog   2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/ChangeLog      2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2017-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
+        https://bugs.webkit.org/show_bug.cgi?id=173469
+
+        Reviewed by Michael Catanzaro.
+
+        Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for
+        backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port.
+
+        * PlatformGTK.cmake:
+        * Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp.
+        (WebKit::gtkStockIDFromContextMenuAction):
+        (WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib):
+        (WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib):
+        (WebKit::WebContextMenuItemGlib::buildActionName):
+        (WebKit::WebContextMenuItemGlib::createActionIfNeeded):
+        * Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h.
+        * UIProcess/API/gtk/WebKitContextMenu.cpp:
+        (webkitContextMenuPopulate):
+        * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
+        (webkitContextMenuActionGetForContextMenuItem):
+        * UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
+        * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
+        (webkitContextMenuItemCreate):
+        (webkitContextMenuItemToWebContextMenuItemGlib):
+        (webkit_context_menu_item_new):
+        (webkit_context_menu_item_new_from_gaction):
+        (webkit_context_menu_item_new_from_stock_action):
+        (webkit_context_menu_item_new_from_stock_action_with_label):
+        (webkit_context_menu_item_new_with_submenu):
+        (webkit_context_menu_item_new_separator):
+        * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
+        * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkitWebViewPopulateContextMenu):
+        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
+        (WebKit::WebContextMenuProxyGtk::append):
+        (WebKit::WebContextMenuProxyGtk::buildMenu):
+        (WebKit::WebContextMenuProxyGtk::populate):
+        * UIProcess/gtk/WebContextMenuProxyGtk.h:
+
</ins><span class="cx"> 2017-06-16  Dan Bernstein  <mitz@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Some declarations have missing or incorrect availability attributes
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake   2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/PlatformGTK.cmake      2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -74,6 +74,7 @@
</span><span class="cx"> 
</span><span class="cx">     Shared/cairo/ShareableBitmapCairo.cpp
</span><span class="cx"> 
</span><ins>+    Shared/glib/WebContextMenuItemGlib.cpp
</ins><span class="cx">     Shared/glib/WebErrorsGlib.cpp
</span><span class="cx"> 
</span><span class="cx">     Shared/gtk/ArgumentCodersGtk.cpp
</span><span class="lines">@@ -83,7 +84,6 @@
</span><span class="cx">     Shared/gtk/NativeWebWheelEventGtk.cpp
</span><span class="cx">     Shared/gtk/PrintInfoGtk.cpp
</span><span class="cx">     Shared/gtk/ProcessExecutablePathGtk.cpp
</span><del>-    Shared/gtk/WebContextMenuItemGtk.cpp
</del><span class="cx">     Shared/gtk/WebErrorsGtk.cpp
</span><span class="cx">     Shared/gtk/WebEventFactory.cpp
</span><span class="cx">     Shared/gtk/WebSelectionData.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedglibWebContextMenuItemGlibcppfromrev218444trunkSourceWebKit2SharedgtkWebContextMenuItemGtkcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.cpp (from rev 218444, trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp) (0 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.cpp                              (rev 0)
+++ trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.cpp 2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -0,0 +1,223 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebContextMenuItemGlib.h"
+
+#include "APIObject.h"
+#include <gio/gio.h>
+
+#if PLATFORM(GTK)
+#include <gtk/gtk.h>
+#endif
+
+using namespace WebCore;
+
+namespace WebKit {
+
+#if PLATFORM(GTK)
+static const char* gtkStockIDFromContextMenuAction(ContextMenuAction action)
+{
+    switch (action) {
+    case ContextMenuItemTagCopyLinkToClipboard:
+    case ContextMenuItemTagCopyImageToClipboard:
+    case ContextMenuItemTagCopyMediaLinkToClipboard:
+    case ContextMenuItemTagCopy:
+        return GTK_STOCK_COPY;
+    case ContextMenuItemTagOpenLinkInNewWindow:
+    case ContextMenuItemTagOpenImageInNewWindow:
+    case ContextMenuItemTagOpenFrameInNewWindow:
+    case ContextMenuItemTagOpenMediaInNewWindow:
+        return GTK_STOCK_OPEN;
+    case ContextMenuItemTagDownloadLinkToDisk:
+    case ContextMenuItemTagDownloadImageToDisk:
+        return GTK_STOCK_SAVE;
+    case ContextMenuItemTagGoBack:
+        return GTK_STOCK_GO_BACK;
+    case ContextMenuItemTagGoForward:
+        return GTK_STOCK_GO_FORWARD;
+    case ContextMenuItemTagStop:
+        return GTK_STOCK_STOP;
+    case ContextMenuItemTagReload:
+        return GTK_STOCK_REFRESH;
+    case ContextMenuItemTagCut:
+        return GTK_STOCK_CUT;
+    case ContextMenuItemTagPaste:
+        return GTK_STOCK_PASTE;
+    case ContextMenuItemTagDelete:
+        return GTK_STOCK_DELETE;
+    case ContextMenuItemTagSelectAll:
+        return GTK_STOCK_SELECT_ALL;
+    case ContextMenuItemTagSpellingGuess:
+        return nullptr;
+    case ContextMenuItemTagIgnoreSpelling:
+        return GTK_STOCK_NO;
+    case ContextMenuItemTagLearnSpelling:
+        return GTK_STOCK_OK;
+    case ContextMenuItemTagOther:
+        return GTK_STOCK_MISSING_IMAGE;
+    case ContextMenuItemTagSearchInSpotlight:
+        return GTK_STOCK_FIND;
+    case ContextMenuItemTagSearchWeb:
+        return GTK_STOCK_FIND;
+    case ContextMenuItemTagOpenWithDefaultApplication:
+        return GTK_STOCK_OPEN;
+    case ContextMenuItemPDFZoomIn:
+        return GTK_STOCK_ZOOM_IN;
+    case ContextMenuItemPDFZoomOut:
+        return GTK_STOCK_ZOOM_OUT;
+    case ContextMenuItemPDFAutoSize:
+        return GTK_STOCK_ZOOM_FIT;
+    case ContextMenuItemPDFNextPage:
+        return GTK_STOCK_GO_FORWARD;
+    case ContextMenuItemPDFPreviousPage:
+        return GTK_STOCK_GO_BACK;
+    // New tags, not part of API
+    case ContextMenuItemTagOpenLink:
+        return GTK_STOCK_OPEN;
+    case ContextMenuItemTagCheckSpelling:
+        return GTK_STOCK_SPELL_CHECK;
+    case ContextMenuItemTagFontMenu:
+        return GTK_STOCK_SELECT_FONT;
+    case ContextMenuItemTagShowFonts:
+        return GTK_STOCK_SELECT_FONT;
+    case ContextMenuItemTagBold:
+        return GTK_STOCK_BOLD;
+    case ContextMenuItemTagItalic:
+        return GTK_STOCK_ITALIC;
+    case ContextMenuItemTagUnderline:
+        return GTK_STOCK_UNDERLINE;
+    case ContextMenuItemTagShowColors:
+        return GTK_STOCK_SELECT_COLOR;
+    case ContextMenuItemTagToggleMediaControls:
+    case ContextMenuItemTagToggleMediaLoop:
+    case ContextMenuItemTagCopyImageUrlToClipboard:
+        // No icon for this.
+        return nullptr;
+    case ContextMenuItemTagEnterVideoFullscreen:
+        return GTK_STOCK_FULLSCREEN;
+    default:
+        return nullptr;
+    }
+}
+#endif // PLATFORM(GTK)
+
+WebContextMenuItemGlib::WebContextMenuItemGlib(ContextMenuItemType type, ContextMenuAction action, const String& title, bool enabled, bool checked)
+    : WebContextMenuItemData(type, action, title, enabled, checked)
+{
+    ASSERT(type != SubmenuType);
+    createActionIfNeeded();
+}
+
+WebContextMenuItemGlib::WebContextMenuItemGlib(const WebContextMenuItemData& data)
+    : WebContextMenuItemData(data.type() == SubmenuType ? ActionType : data.type(), data.action(), data.title(), data.enabled(), data.checked())
+{
+    createActionIfNeeded();
+}
+
+WebContextMenuItemGlib::WebContextMenuItemGlib(const WebContextMenuItemGlib& data, Vector<WebContextMenuItemGlib>&& submenu)
+    : WebContextMenuItemData(ActionType, data.action(), data.title(), data.enabled(), false)
+{
+    m_gAction = data.gAction();
+    m_submenuItems = WTFMove(submenu);
+#if PLATFORM(GTK)
+    m_gtkAction = data.gtkAction();
+#endif
+}
+
+static bool isGActionChecked(GAction* action)
+{
+    if (!g_action_get_state_type(action))
+        return false;
+
+    ASSERT(g_variant_type_equal(g_action_get_state_type(action), G_VARIANT_TYPE_BOOLEAN));
+    GRefPtr<GVariant> state = adoptGRef(g_action_get_state(action));
+    return g_variant_get_boolean(state.get());
+}
+
+WebContextMenuItemGlib::WebContextMenuItemGlib(GAction* action, const String& title, GVariant* target)
+    : WebContextMenuItemData(g_action_get_state_type(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, title, g_action_get_enabled(action), isGActionChecked(action))
+    , m_gAction(action)
+    , m_gActionTarget(target)
+{
+    createActionIfNeeded();
+}
+
+#if PLATFORM(GTK)
+WebContextMenuItemGlib::WebContextMenuItemGlib(GtkAction* action)
+    : WebContextMenuItemData(GTK_IS_TOGGLE_ACTION(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(gtk_action_get_label(action)), gtk_action_get_sensitive(action), GTK_IS_TOGGLE_ACTION(action) ? gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)) : false)
+{
+    m_gtkAction = action;
+    createActionIfNeeded();
+    g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", g_object_ref(m_gtkAction), g_object_unref);
+}
+#endif
+
+WebContextMenuItemGlib::~WebContextMenuItemGlib()
+{
+}
+
+GUniquePtr<char> WebContextMenuItemGlib::buildActionName() const
+{
+#if PLATFORM(GTK)
+    if (m_gtkAction)
+        return GUniquePtr<char>(g_strdup(gtk_action_get_name(m_gtkAction)));
+#endif
+
+    static uint64_t actionID = 0;
+    return GUniquePtr<char>(g_strdup_printf("action-%" PRIu64, ++actionID));
+}
+
+void WebContextMenuItemGlib::createActionIfNeeded()
+{
+    if (type() == SeparatorType)
+        return;
+
+    if (!m_gAction) {
+        auto actionName = buildActionName();
+        if (type() == CheckableActionType)
+            m_gAction = adoptGRef(G_ACTION(g_simple_action_new_stateful(actionName.get(), nullptr, g_variant_new_boolean(checked()))));
+        else
+            m_gAction = adoptGRef(G_ACTION(g_simple_action_new(actionName.get(), nullptr)));
+        g_simple_action_set_enabled(G_SIMPLE_ACTION(m_gAction.get()), enabled());
+    }
+
+#if PLATFORM(GTK)
+    // Create the GtkAction for backwards compatibility only.
+    if (!m_gtkAction) {
+        if (type() == CheckableActionType) {
+            m_gtkAction = GTK_ACTION(gtk_toggle_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), nullptr, gtkStockIDFromContextMenuAction(action())));
+            gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(m_gtkAction), checked());
+        } else
+            m_gtkAction = gtk_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), 0, gtkStockIDFromContextMenuAction(action()));
+        gtk_action_set_sensitive(m_gtkAction, enabled());
+        g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", m_gtkAction, g_object_unref);
+    }
+
+    g_signal_connect_object(m_gAction.get(), "activate", G_CALLBACK(gtk_action_activate), m_gtkAction, G_CONNECT_SWAPPED);
+#endif
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedglibWebContextMenuItemGlibhfromrev218444trunkSourceWebKit2SharedgtkWebContextMenuItemGtkh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.h (from rev 218444, trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h) (0 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.h                                (rev 0)
+++ trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.h   2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "WebContextMenuItemData.h"
+#include <wtf/glib/GRefPtr.h>
+#include <wtf/glib/GUniquePtr.h>
+
+typedef struct _GtkAction GtkAction;
+typedef struct _GAction GAction;
+
+namespace WebKit {
+
+class WebContextMenuItemGlib final : public WebContextMenuItemData {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    WebContextMenuItemGlib(WebCore::ContextMenuItemType, WebCore::ContextMenuAction, const String& title, bool enabled = true, bool checked = false);
+    WebContextMenuItemGlib(const WebContextMenuItemData&);
+    WebContextMenuItemGlib(const WebContextMenuItemGlib&, Vector<WebContextMenuItemGlib>&& submenu);
+    WebContextMenuItemGlib(GAction*, const String& title, GVariant* target = nullptr);
+#if PLATFORM(GTK)
+    WebContextMenuItemGlib(GtkAction*);
+#endif
+    ~WebContextMenuItemGlib();
+
+    // We don't use the SubmenuType internally, so check if we have submenu items.
+    WebCore::ContextMenuItemType type() const { return m_submenuItems.isEmpty() ? WebContextMenuItemData::type() : WebCore::SubmenuType; }
+    GAction* gAction() const { return m_gAction.get(); }
+    GVariant* gActionTarget() const { return m_gActionTarget.get(); }
+    const Vector<WebContextMenuItemGlib>& submenuItems() const { return m_submenuItems; }
+
+#if PLATFORM(GTK)
+    GtkAction* gtkAction() const { return m_gtkAction; }
+#endif
+
+private:
+    GUniquePtr<char> buildActionName() const;
+    void createActionIfNeeded();
+
+    GRefPtr<GAction> m_gAction;
+    GRefPtr<GVariant> m_gActionTarget;
+    Vector<WebContextMenuItemGlib> m_submenuItems;
+#if PLATFORM(GTK)
+    GtkAction* m_gtkAction { nullptr };
+#endif
+};
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkWebContextMenuItemGtkcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp        2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp   2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -1,205 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebContextMenuItemGtk.h"
-
-#include <gtk/gtk.h>
-#include <wtf/glib/GUniquePtr.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-static const char* gtkStockIDFromContextMenuAction(ContextMenuAction action)
-{
-    switch (action) {
-    case ContextMenuItemTagCopyLinkToClipboard:
-    case ContextMenuItemTagCopyImageToClipboard:
-    case ContextMenuItemTagCopyMediaLinkToClipboard:
-    case ContextMenuItemTagCopy:
-        return GTK_STOCK_COPY;
-    case ContextMenuItemTagOpenLinkInNewWindow:
-    case ContextMenuItemTagOpenImageInNewWindow:
-    case ContextMenuItemTagOpenFrameInNewWindow:
-    case ContextMenuItemTagOpenMediaInNewWindow:
-        return GTK_STOCK_OPEN;
-    case ContextMenuItemTagDownloadLinkToDisk:
-    case ContextMenuItemTagDownloadImageToDisk:
-        return GTK_STOCK_SAVE;
-    case ContextMenuItemTagGoBack:
-        return GTK_STOCK_GO_BACK;
-    case ContextMenuItemTagGoForward:
-        return GTK_STOCK_GO_FORWARD;
-    case ContextMenuItemTagStop:
-        return GTK_STOCK_STOP;
-    case ContextMenuItemTagReload:
-        return GTK_STOCK_REFRESH;
-    case ContextMenuItemTagCut:
-        return GTK_STOCK_CUT;
-    case ContextMenuItemTagPaste:
-        return GTK_STOCK_PASTE;
-    case ContextMenuItemTagDelete:
-        return GTK_STOCK_DELETE;
-    case ContextMenuItemTagSelectAll:
-        return GTK_STOCK_SELECT_ALL;
-    case ContextMenuItemTagSpellingGuess:
-        return 0;
-    case ContextMenuItemTagIgnoreSpelling:
-        return GTK_STOCK_NO;
-    case ContextMenuItemTagLearnSpelling:
-        return GTK_STOCK_OK;
-    case ContextMenuItemTagOther:
-        return GTK_STOCK_MISSING_IMAGE;
-    case ContextMenuItemTagSearchInSpotlight:
-        return GTK_STOCK_FIND;
-    case ContextMenuItemTagSearchWeb:
-        return GTK_STOCK_FIND;
-    case ContextMenuItemTagOpenWithDefaultApplication:
-        return GTK_STOCK_OPEN;
-    case ContextMenuItemPDFZoomIn:
-        return GTK_STOCK_ZOOM_IN;
-    case ContextMenuItemPDFZoomOut:
-        return GTK_STOCK_ZOOM_OUT;
-    case ContextMenuItemPDFAutoSize:
-        return GTK_STOCK_ZOOM_FIT;
-    case ContextMenuItemPDFNextPage:
-        return GTK_STOCK_GO_FORWARD;
-    case ContextMenuItemPDFPreviousPage:
-        return GTK_STOCK_GO_BACK;
-    // New tags, not part of API
-    case ContextMenuItemTagOpenLink:
-        return GTK_STOCK_OPEN;
-    case ContextMenuItemTagCheckSpelling:
-        return GTK_STOCK_SPELL_CHECK;
-    case ContextMenuItemTagFontMenu:
-        return GTK_STOCK_SELECT_FONT;
-    case ContextMenuItemTagShowFonts:
-        return GTK_STOCK_SELECT_FONT;
-    case ContextMenuItemTagBold:
-        return GTK_STOCK_BOLD;
-    case ContextMenuItemTagItalic:
-        return GTK_STOCK_ITALIC;
-    case ContextMenuItemTagUnderline:
-        return GTK_STOCK_UNDERLINE;
-    case ContextMenuItemTagShowColors:
-        return GTK_STOCK_SELECT_COLOR;
-    case ContextMenuItemTagToggleMediaControls:
-    case ContextMenuItemTagToggleMediaLoop:
-    case ContextMenuItemTagCopyImageUrlToClipboard:
-        // No icon for this.
-        return 0;
-    case ContextMenuItemTagEnterVideoFullscreen:
-        return GTK_STOCK_FULLSCREEN;
-    default:
-        return 0;
-    }
-}
-
-WebContextMenuItemGtk::WebContextMenuItemGtk(ContextMenuItemType type, ContextMenuAction action, const String& title, bool enabled, bool checked)
-    : WebContextMenuItemData(type, action, title, enabled, checked)
-{
-    ASSERT(type != SubmenuType);
-    createActionIfNeeded();
-}
-
-WebContextMenuItemGtk::WebContextMenuItemGtk(const WebContextMenuItemData& data)
-    : WebContextMenuItemData(data.type() == SubmenuType ? ActionType : data.type(), data.action(), data.title(), data.enabled(), data.checked())
-{
-    createActionIfNeeded();
-}
-
-WebContextMenuItemGtk::WebContextMenuItemGtk(const WebContextMenuItemGtk& data, Vector<WebContextMenuItemGtk>&& submenu)
-    : WebContextMenuItemData(ActionType, data.action(), data.title(), data.enabled(), false)
-{
-    m_gAction = data.gAction();
-    m_gtkAction = data.gtkAction();
-    m_submenuItems = WTFMove(submenu);
-}
-
-WebContextMenuItemGtk::WebContextMenuItemGtk(GtkAction* action)
-    : WebContextMenuItemData(GTK_IS_TOGGLE_ACTION(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(gtk_action_get_label(action)), gtk_action_get_sensitive(action), GTK_IS_TOGGLE_ACTION(action) ? gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)) : false)
-{
-    m_gtkAction = action;
-    createActionIfNeeded();
-    g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", g_object_ref(m_gtkAction), g_object_unref);
-}
-
-static bool isGActionChecked(GAction* action)
-{
-    if (!g_action_get_state_type(action))
-        return false;
-
-    ASSERT(g_variant_type_equal(g_action_get_state_type(action), G_VARIANT_TYPE_BOOLEAN));
-    GRefPtr<GVariant> state = adoptGRef(g_action_get_state(action));
-    return g_variant_get_boolean(state.get());
-}
-
-WebContextMenuItemGtk::WebContextMenuItemGtk(GAction* action, const String& title, GVariant* target)
-    : WebContextMenuItemData(g_action_get_state_type(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, title, g_action_get_enabled(action), isGActionChecked(action))
-    , m_gAction(action)
-    , m_gActionTarget(target)
-{
-    createActionIfNeeded();
-}
-
-WebContextMenuItemGtk::~WebContextMenuItemGtk()
-{
-}
-
-void WebContextMenuItemGtk::createActionIfNeeded()
-{
-    if (type() == SeparatorType)
-        return;
-
-    static uint64_t actionID = 0;
-    if (!m_gAction) {
-        GUniquePtr<char> actionName;
-        if (m_gtkAction)
-            actionName.reset(g_strdup(gtk_action_get_name(m_gtkAction)));
-        else
-            actionName.reset(g_strdup_printf("action-%" PRIu64, ++actionID));
-        if (type() == CheckableActionType)
-            m_gAction = adoptGRef(G_ACTION(g_simple_action_new_stateful(actionName.get(), nullptr, g_variant_new_boolean(checked()))));
-        else
-            m_gAction = adoptGRef(G_ACTION(g_simple_action_new(actionName.get(), nullptr)));
-        g_simple_action_set_enabled(G_SIMPLE_ACTION(m_gAction.get()), enabled());
-    }
-
-    // Create the GtkAction for backwards compatibility only.
-    if (!m_gtkAction) {
-        if (type() == CheckableActionType) {
-            m_gtkAction = GTK_ACTION(gtk_toggle_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), nullptr, gtkStockIDFromContextMenuAction(action())));
-            gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(m_gtkAction), checked());
-        } else
-            m_gtkAction = gtk_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), 0, gtkStockIDFromContextMenuAction(action()));
-        gtk_action_set_sensitive(m_gtkAction, enabled());
-        g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", m_gtkAction, g_object_unref);
-    }
-
-    g_signal_connect_object(m_gAction.get(), "activate", G_CALLBACK(gtk_action_activate), m_gtkAction, G_CONNECT_SWAPPED);
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkWebContextMenuItemGtkh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h  2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h     2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebContextMenuItemGtk_h
-#define WebContextMenuItemGtk_h
-
-#include "APIObject.h"
-#include "WebContextMenuItemData.h"
-#include <wtf/glib/GRefPtr.h>
-
-typedef struct _GtkAction GtkAction;
-typedef struct _GAction GAction;
-
-namespace WebKit {
-
-class WebContextMenuItemGtk : public WebContextMenuItemData {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    WebContextMenuItemGtk(WebCore::ContextMenuItemType, WebCore::ContextMenuAction, const String& title, bool enabled = true, bool checked = false);
-    WebContextMenuItemGtk(const WebContextMenuItemData&);
-    WebContextMenuItemGtk(const WebContextMenuItemGtk&, Vector<WebContextMenuItemGtk>&& submenu);
-    WebContextMenuItemGtk(GtkAction*);
-    WebContextMenuItemGtk(GAction*, const String& title, GVariant* target = nullptr);
-    ~WebContextMenuItemGtk();
-
-    // We don't use the SubmenuType internally, so check if we have submenu items.
-    WebCore::ContextMenuItemType type() const { return m_submenuItems.isEmpty() ? WebContextMenuItemData::type() : WebCore::SubmenuType; }
-    GtkAction* gtkAction() const { return m_gtkAction; }
-    GAction* gAction() const { return m_gAction.get(); }
-    GVariant* gActionTarget() const { return m_gActionTarget.get(); }
-    const Vector<WebContextMenuItemGtk>& submenuItems() const { return m_submenuItems; }
-
-private:
-    void createActionIfNeeded();
-
-    GRefPtr<GAction> m_gAction;
-    GRefPtr<GVariant> m_gActionTarget;
-    GtkAction* m_gtkAction { nullptr };
-    Vector<WebContextMenuItemGtk> m_submenuItems;
-};
-
-} // namespace WebKit
-
-#endif // WebContextMenuItemGtk_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenucpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp     2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp        2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -77,11 +77,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<WebContextMenuItemGtk>& contextMenuItems)
</del><ins>+void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<WebContextMenuItemGlib>& contextMenuItems)
</ins><span class="cx"> {
</span><span class="cx">     for (GList* item = menu->priv->items; item; item = g_list_next(item)) {
</span><span class="cx">         WebKitContextMenuItem* menuItem = WEBKIT_CONTEXT_MENU_ITEM(item->data);
</span><del>-        contextMenuItems.append(webkitContextMenuItemToWebContextMenuItemGtk(menuItem));
</del><ins>+        contextMenuItems.append(webkitContextMenuItemToWebContextMenuItemGlib(menuItem));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuActionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp      2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp 2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">     return ContextMenuItemBaseApplicationTag;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGtk& menuItem)
</del><ins>+WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGlib& menuItem)
</ins><span class="cx"> {
</span><span class="cx">     switch (menuItem.action()) {
</span><span class="cx">     case ContextMenuItemTagNoAction:
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuActionsPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h 2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h    2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -17,15 +17,12 @@
</span><span class="cx">  * Boston, MA 02110-1301, USA.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef WebKitContextMenuActionsPrivate_h
-#define WebKitContextMenuActionsPrivate_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#include "WebContextMenuItemGtk.h"
</del><ins>+#include "WebContextMenuItemGlib.h"
</ins><span class="cx"> #include "WebKitContextMenuActions.h"
</span><span class="cx"> 
</span><span class="cx"> bool webkitContextMenuActionIsCheckable(WebKitContextMenuAction);
</span><span class="cx"> WebCore::ContextMenuAction webkitContextMenuActionGetActionTag(WebKitContextMenuAction);
</span><del>-WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGtk&);
</del><ins>+WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGlib&);
</ins><span class="cx"> String webkitContextMenuActionGetLabel(WebKitContextMenuAction);
</span><del>-
-#endif // WebKitPrintOperationPrivate_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp 2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp    2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "APIArray.h"
</span><span class="cx"> #include "WebContextMenuItem.h"
</span><del>-#include "WebContextMenuItemGtk.h"
</del><ins>+#include "WebContextMenuItemGlib.h"
</ins><span class="cx"> #include "WebKitContextMenuActionsPrivate.h"
</span><span class="cx"> #include "WebKitContextMenuItemPrivate.h"
</span><span class="cx"> #include "WebKitContextMenuPrivate.h"
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">             webkitContextMenuSetParentItem(subMenu.get(), 0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    std::unique_ptr<WebContextMenuItemGtk> menuItem;
</del><ins>+    std::unique_ptr<WebContextMenuItemGlib> menuItem;
</ins><span class="cx">     GRefPtr<WebKitContextMenu> subMenu;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -95,7 +95,7 @@
</span><span class="cx"> {
</span><span class="cx">     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, NULL));
</span><span class="cx"> 
</span><del>-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(itemData);
</del><ins>+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(itemData);
</ins><span class="cx">     const Vector<WebContextMenuItemData>& subMenu = itemData.submenu();
</span><span class="cx">     if (!subMenu.isEmpty())
</span><span class="cx">         webkitContextMenuItemSetSubMenu(item, adoptGRef(webkitContextMenuCreate(subMenu)));
</span><span class="lines">@@ -103,12 +103,12 @@
</span><span class="cx">     return item;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebContextMenuItemGtk webkitContextMenuItemToWebContextMenuItemGtk(WebKitContextMenuItem* item)
</del><ins>+WebContextMenuItemGlib webkitContextMenuItemToWebContextMenuItemGlib(WebKitContextMenuItem* item)
</ins><span class="cx"> {
</span><span class="cx">     if (item->priv->subMenu) {
</span><del>-        Vector<WebContextMenuItemGtk> subMenuItems;
</del><ins>+        Vector<WebContextMenuItemGlib> subMenuItems;
</ins><span class="cx">         webkitContextMenuPopulate(item->priv->subMenu.get(), subMenuItems);
</span><del>-        return WebContextMenuItemGtk(*item->priv->menuItem, WTFMove(subMenuItems));
</del><ins>+        return WebContextMenuItemGlib(*item->priv->menuItem, WTFMove(subMenuItems));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return *item->priv->menuItem;
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">     g_return_val_if_fail(GTK_IS_ACTION(action), nullptr);
</span><span class="cx"> 
</span><span class="cx">     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
</span><del>-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(action);
</del><ins>+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(action);
</ins><span class="cx"> 
</span><span class="cx">     return item;
</span><span class="cx"> }
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx">     g_return_val_if_fail(!target || g_variant_is_of_type(target, g_action_get_parameter_type(action)), nullptr);
</span><span class="cx"> 
</span><span class="cx">     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
</span><del>-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(action, String::fromUTF8(label), target);
</del><ins>+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(action, String::fromUTF8(label), target);
</ins><span class="cx"> 
</span><span class="cx">     return item;
</span><span class="cx"> }
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
</span><span class="cx">     ContextMenuItemType type = webkitContextMenuActionIsCheckable(action) ? CheckableActionType : ActionType;
</span><del>-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(type, webkitContextMenuActionGetActionTag(action), webkitContextMenuActionGetLabel(action));
</del><ins>+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(type, webkitContextMenuActionGetActionTag(action), webkitContextMenuActionGetLabel(action));
</ins><span class="cx"> 
</span><span class="cx">     return item;
</span><span class="cx"> }
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
</span><span class="cx">     ContextMenuItemType type = webkitContextMenuActionIsCheckable(action) ? CheckableActionType : ActionType;
</span><del>-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(type, webkitContextMenuActionGetActionTag(action), String::fromUTF8(label));
</del><ins>+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(type, webkitContextMenuActionGetActionTag(action), String::fromUTF8(label));
</ins><span class="cx"> 
</span><span class="cx">     return item;
</span><span class="cx"> }
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
</span><del>-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(label));
</del><ins>+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(label));
</ins><span class="cx">     item->priv->subMenu = submenu;
</span><span class="cx">     webkitContextMenuSetParentItem(submenu, item);
</span><span class="cx"> 
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx"> WebKitContextMenuItem* webkit_context_menu_item_new_separator(void)
</span><span class="cx"> {
</span><span class="cx">     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
</span><del>-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(SeparatorType, ContextMenuItemTagNoAction, String());
</del><ins>+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(SeparatorType, ContextMenuItemTagNoAction, String());
</ins><span class="cx"> 
</span><span class="cx">     return item;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuItemPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h    2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h       2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -19,9 +19,9 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include "WebContextMenuItemGtk.h"
</del><ins>+#include "WebContextMenuItemGlib.h"
</ins><span class="cx"> #include "WebKitContextMenuItem.h"
</span><span class="cx"> 
</span><span class="cx"> WebKitContextMenuItem* webkitContextMenuItemCreate(const WebKit::WebContextMenuItemData&);
</span><del>-WebKit::WebContextMenuItemGtk webkitContextMenuItemToWebContextMenuItemGtk(WebKitContextMenuItem*);
</del><ins>+WebKit::WebContextMenuItemGlib webkitContextMenuItemToWebContextMenuItemGlib(WebKitContextMenuItem*);
</ins><span class="cx"> WebKit::WebContextMenuItemData webkitContextMenuItemToWebContextMenuItemData(WebKitContextMenuItem*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitContextMenuPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h        2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h   2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -19,11 +19,11 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include "WebContextMenuItemGtk.h"
</del><ins>+#include "WebContextMenuItemGlib.h"
</ins><span class="cx"> #include "WebKitContextMenu.h"
</span><span class="cx"> 
</span><span class="cx"> WebKitContextMenu* webkitContextMenuCreate(const Vector<WebKit::WebContextMenuItemData>&);
</span><del>-void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemGtk>&);
</del><ins>+void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemGlib>&);
</ins><span class="cx"> void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemData>&);
</span><span class="cx"> void webkitContextMenuSetParentItem(WebKitContextMenu*, WebKitContextMenuItem*);
</span><span class="cx"> WebKitContextMenuItem* webkitContextMenuGetParentItem(WebKitContextMenu*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp    2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -2182,7 +2182,7 @@
</span><span class="cx">     if (returnValue)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    Vector<WebContextMenuItemGtk> contextMenuItems;
</del><ins>+    Vector<WebContextMenuItemGlib> contextMenuItems;
</ins><span class="cx">     webkitContextMenuPopulate(contextMenu.get(), contextMenuItems);
</span><span class="cx">     contextMenuProxy->populate(contextMenuItems);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebContextMenuProxyGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp    2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp       2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     page->contextMenuItemSelected(item);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebContextMenuProxyGtk::append(GMenu* menu, const WebContextMenuItemGtk& menuItem)
</del><ins>+void WebContextMenuProxyGtk::append(GMenu* menu, const WebContextMenuItemGlib& menuItem)
</ins><span class="cx"> {
</span><span class="cx">     unsigned long signalHandlerId;
</span><span class="cx">     GRefPtr<GMenuItem> gMenuItem;
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">     g_menu_append_item(menu, gMenuItem.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GRefPtr<GMenu> WebContextMenuProxyGtk::buildMenu(const Vector<WebContextMenuItemGtk>& items)
</del><ins>+GRefPtr<GMenu> WebContextMenuProxyGtk::buildMenu(const Vector<WebContextMenuItemGlib>& items)
</ins><span class="cx"> {
</span><span class="cx">     GRefPtr<GMenu> menu = adoptGRef(g_menu_new());
</span><span class="cx">     GMenu* sectionMenu = menu.get();
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     return menu;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebContextMenuProxyGtk::populate(const Vector<WebContextMenuItemGtk>& items)
</del><ins>+void WebContextMenuProxyGtk::populate(const Vector<WebContextMenuItemGlib>& items)
</ins><span class="cx"> {
</span><span class="cx">     GRefPtr<GMenu> menu = buildMenu(items);
</span><span class="cx">     gtk_menu_shell_bind_model(GTK_MENU_SHELL(m_menu), G_MENU_MODEL(menu.get()), nullptr, TRUE);
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">             g_menu_append_section(menu.get(), nullptr, G_MENU_MODEL(section.get()));
</span><span class="cx">             sectionMenu = section.get();
</span><span class="cx">         } else {
</span><del>-            WebContextMenuItemGtk menuitem(item->data());
</del><ins>+            WebContextMenuItemGlib menuitem(item->data());
</ins><span class="cx">             append(sectionMenu, menuitem);
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebContextMenuProxyGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h (218444 => 218445)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h      2017-06-17 06:28:09 UTC (rev 218444)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h 2017-06-17 07:21:03 UTC (rev 218445)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx"> 
</span><del>-#include "WebContextMenuItemGtk.h"
</del><ins>+#include "WebContextMenuItemGlib.h"
</ins><span class="cx"> #include "WebContextMenuProxy.h"
</span><span class="cx"> #include <WebCore/IntPoint.h>
</span><span class="cx"> #include <wtf/HashMap.h>
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">     }
</span><span class="cx">     ~WebContextMenuProxyGtk();
</span><span class="cx"> 
</span><del>-    void populate(const Vector<WebContextMenuItemGtk>&);
</del><ins>+    void populate(const Vector<WebContextMenuItemGlib>&);
</ins><span class="cx">     GtkMenu* gtkMenu() const { return m_menu; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">     WebContextMenuProxyGtk(GtkWidget*, WebPageProxy&, const ContextMenuContextData&, const UserData&);
</span><span class="cx">     void show() override;
</span><span class="cx">     void showContextMenuWithItems(const Vector<WebContextMenuItemData>&) override;
</span><del>-    void append(GMenu*, const WebContextMenuItemGtk&);
-    GRefPtr<GMenu> buildMenu(const Vector<WebContextMenuItemGtk>&);
</del><ins>+    void append(GMenu*, const WebContextMenuItemGlib&);
+    GRefPtr<GMenu> buildMenu(const Vector<WebContextMenuItemGlib>&);
</ins><span class="cx">     void populate(const Vector<RefPtr<WebContextMenuItem>>&);
</span><span class="cx">     static void menuPositionFunction(GtkMenu*, gint*, gint*, gboolean*, WebContextMenuProxyGtk*);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>