Title: [218445] trunk/Source/WebKit2
Revision
218445
Author
[email protected]
Date
2017-06-17 00:21:03 -0700 (Sat, 17 Jun 2017)

Log Message

[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:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (218444 => 218445)


--- 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)
@@ -1,3 +1,45 @@
+2017-06-17  Carlos Garcia Campos  <[email protected]>
+
+        [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:
+
 2017-06-16  Dan Bernstein  <[email protected]>
 
         [Cocoa] Some declarations have missing or incorrect availability attributes

Modified: trunk/Source/WebKit2/PlatformGTK.cmake (218444 => 218445)


--- 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)
@@ -74,6 +74,7 @@
 
     Shared/cairo/ShareableBitmapCairo.cpp
 
+    Shared/glib/WebContextMenuItemGlib.cpp
     Shared/glib/WebErrorsGlib.cpp
 
     Shared/gtk/ArgumentCodersGtk.cpp
@@ -83,7 +84,6 @@
     Shared/gtk/NativeWebWheelEventGtk.cpp
     Shared/gtk/PrintInfoGtk.cpp
     Shared/gtk/ProcessExecutablePathGtk.cpp
-    Shared/gtk/WebContextMenuItemGtk.cpp
     Shared/gtk/WebErrorsGtk.cpp
     Shared/gtk/WebEventFactory.cpp
     Shared/gtk/WebSelectionData.cpp

Copied: trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.cpp (from rev 218444, trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp) (0 => 218445)


--- 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)
@@ -0,0 +1,223 @@
+/*
+ * 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

Copied: trunk/Source/WebKit2/Shared/glib/WebContextMenuItemGlib.h (from rev 218444, trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h) (0 => 218445)


--- 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)
@@ -0,0 +1,71 @@
+/*
+ * 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

Deleted: trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp (218444 => 218445)


--- 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)
@@ -1,205 +0,0 @@
-/*
- * 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

Deleted: trunk/Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h (218444 => 218445)


--- 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)
@@ -1,66 +0,0 @@
-/*
- * 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

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp (218444 => 218445)


--- 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)
@@ -77,11 +77,11 @@
     }
 }
 
-void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<WebContextMenuItemGtk>& contextMenuItems)
+void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<WebContextMenuItemGlib>& contextMenuItems)
 {
     for (GList* item = menu->priv->items; item; item = g_list_next(item)) {
         WebKitContextMenuItem* menuItem = WEBKIT_CONTEXT_MENU_ITEM(item->data);
-        contextMenuItems.append(webkitContextMenuItemToWebContextMenuItemGtk(menuItem));
+        contextMenuItems.append(webkitContextMenuItemToWebContextMenuItemGlib(menuItem));
     }
 }
 

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp (218444 => 218445)


--- 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)
@@ -135,7 +135,7 @@
     return ContextMenuItemBaseApplicationTag;
 }
 
-WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGtk& menuItem)
+WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGlib& menuItem)
 {
     switch (menuItem.action()) {
     case ContextMenuItemTagNoAction:

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h (218444 => 218445)


--- 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)
@@ -17,15 +17,12 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef WebKitContextMenuActionsPrivate_h
-#define WebKitContextMenuActionsPrivate_h
+#pragma once
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenuActions.h"
 
 bool webkitContextMenuActionIsCheckable(WebKitContextMenuAction);
 WebCore::ContextMenuAction webkitContextMenuActionGetActionTag(WebKitContextMenuAction);
-WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGtk&);
+WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGlib&);
 String webkitContextMenuActionGetLabel(WebKitContextMenuAction);
-
-#endif // WebKitPrintOperationPrivate_h

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp (218444 => 218445)


--- 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)
@@ -22,7 +22,7 @@
 
 #include "APIArray.h"
 #include "WebContextMenuItem.h"
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenuActionsPrivate.h"
 #include "WebKitContextMenuItemPrivate.h"
 #include "WebKitContextMenuPrivate.h"
@@ -57,7 +57,7 @@
             webkitContextMenuSetParentItem(subMenu.get(), 0);
     }
 
-    std::unique_ptr<WebContextMenuItemGtk> menuItem;
+    std::unique_ptr<WebContextMenuItemGlib> menuItem;
     GRefPtr<WebKitContextMenu> subMenu;
 };
 
@@ -95,7 +95,7 @@
 {
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, NULL));
 
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(itemData);
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(itemData);
     const Vector<WebContextMenuItemData>& subMenu = itemData.submenu();
     if (!subMenu.isEmpty())
         webkitContextMenuItemSetSubMenu(item, adoptGRef(webkitContextMenuCreate(subMenu)));
@@ -103,12 +103,12 @@
     return item;
 }
 
-WebContextMenuItemGtk webkitContextMenuItemToWebContextMenuItemGtk(WebKitContextMenuItem* item)
+WebContextMenuItemGlib webkitContextMenuItemToWebContextMenuItemGlib(WebKitContextMenuItem* item)
 {
     if (item->priv->subMenu) {
-        Vector<WebContextMenuItemGtk> subMenuItems;
+        Vector<WebContextMenuItemGlib> subMenuItems;
         webkitContextMenuPopulate(item->priv->subMenu.get(), subMenuItems);
-        return WebContextMenuItemGtk(*item->priv->menuItem, WTFMove(subMenuItems));
+        return WebContextMenuItemGlib(*item->priv->menuItem, WTFMove(subMenuItems));
     }
 
     return *item->priv->menuItem;
@@ -140,7 +140,7 @@
     g_return_val_if_fail(GTK_IS_ACTION(action), nullptr);
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(action);
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(action);
 
     return item;
 }
@@ -166,7 +166,7 @@
     g_return_val_if_fail(!target || g_variant_is_of_type(target, g_action_get_parameter_type(action)), nullptr);
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(action, String::fromUTF8(label), target);
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(action, String::fromUTF8(label), target);
 
     return item;
 }
@@ -193,7 +193,7 @@
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
     ContextMenuItemType type = webkitContextMenuActionIsCheckable(action) ? CheckableActionType : ActionType;
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(type, webkitContextMenuActionGetActionTag(action), webkitContextMenuActionGetLabel(action));
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(type, webkitContextMenuActionGetActionTag(action), webkitContextMenuActionGetLabel(action));
 
     return item;
 }
@@ -215,7 +215,7 @@
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
     ContextMenuItemType type = webkitContextMenuActionIsCheckable(action) ? CheckableActionType : ActionType;
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(type, webkitContextMenuActionGetActionTag(action), String::fromUTF8(label));
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(type, webkitContextMenuActionGetActionTag(action), String::fromUTF8(label));
 
     return item;
 }
@@ -238,7 +238,7 @@
         return nullptr;
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(label));
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(label));
     item->priv->subMenu = submenu;
     webkitContextMenuSetParentItem(submenu, item);
 
@@ -255,7 +255,7 @@
 WebKitContextMenuItem* webkit_context_menu_item_new_separator(void)
 {
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(SeparatorType, ContextMenuItemTagNoAction, String());
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(SeparatorType, ContextMenuItemTagNoAction, String());
 
     return item;
 }

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h (218444 => 218445)


--- 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)
@@ -19,9 +19,9 @@
 
 #pragma once
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenuItem.h"
 
 WebKitContextMenuItem* webkitContextMenuItemCreate(const WebKit::WebContextMenuItemData&);
-WebKit::WebContextMenuItemGtk webkitContextMenuItemToWebContextMenuItemGtk(WebKitContextMenuItem*);
+WebKit::WebContextMenuItemGlib webkitContextMenuItemToWebContextMenuItemGlib(WebKitContextMenuItem*);
 WebKit::WebContextMenuItemData webkitContextMenuItemToWebContextMenuItemData(WebKitContextMenuItem*);

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h (218444 => 218445)


--- 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)
@@ -19,11 +19,11 @@
 
 #pragma once
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenu.h"
 
 WebKitContextMenu* webkitContextMenuCreate(const Vector<WebKit::WebContextMenuItemData>&);
-void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemGtk>&);
+void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemGlib>&);
 void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemData>&);
 void webkitContextMenuSetParentItem(WebKitContextMenu*, WebKitContextMenuItem*);
 WebKitContextMenuItem* webkitContextMenuGetParentItem(WebKitContextMenu*);

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (218444 => 218445)


--- 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)
@@ -2182,7 +2182,7 @@
     if (returnValue)
         return;
 
-    Vector<WebContextMenuItemGtk> contextMenuItems;
+    Vector<WebContextMenuItemGlib> contextMenuItems;
     webkitContextMenuPopulate(contextMenu.get(), contextMenuItems);
     contextMenuProxy->populate(contextMenuItems);
 

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp (218444 => 218445)


--- 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)
@@ -62,7 +62,7 @@
     page->contextMenuItemSelected(item);
 }
 
-void WebContextMenuProxyGtk::append(GMenu* menu, const WebContextMenuItemGtk& menuItem)
+void WebContextMenuProxyGtk::append(GMenu* menu, const WebContextMenuItemGlib& menuItem)
 {
     unsigned long signalHandlerId;
     GRefPtr<GMenuItem> gMenuItem;
@@ -102,7 +102,7 @@
     g_menu_append_item(menu, gMenuItem.get());
 }
 
-GRefPtr<GMenu> WebContextMenuProxyGtk::buildMenu(const Vector<WebContextMenuItemGtk>& items)
+GRefPtr<GMenu> WebContextMenuProxyGtk::buildMenu(const Vector<WebContextMenuItemGlib>& items)
 {
     GRefPtr<GMenu> menu = adoptGRef(g_menu_new());
     GMenu* sectionMenu = menu.get();
@@ -118,7 +118,7 @@
     return menu;
 }
 
-void WebContextMenuProxyGtk::populate(const Vector<WebContextMenuItemGtk>& items)
+void WebContextMenuProxyGtk::populate(const Vector<WebContextMenuItemGlib>& items)
 {
     GRefPtr<GMenu> menu = buildMenu(items);
     gtk_menu_shell_bind_model(GTK_MENU_SHELL(m_menu), G_MENU_MODEL(menu.get()), nullptr, TRUE);
@@ -134,7 +134,7 @@
             g_menu_append_section(menu.get(), nullptr, G_MENU_MODEL(section.get()));
             sectionMenu = section.get();
         } else {
-            WebContextMenuItemGtk menuitem(item->data());
+            WebContextMenuItemGlib menuitem(item->data());
             append(sectionMenu, menuitem);
         }
     }

Modified: trunk/Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h (218444 => 218445)


--- 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)
@@ -28,7 +28,7 @@
 
 #if ENABLE(CONTEXT_MENUS)
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebContextMenuProxy.h"
 #include <WebCore/IntPoint.h>
 #include <wtf/HashMap.h>
@@ -50,7 +50,7 @@
     }
     ~WebContextMenuProxyGtk();
 
-    void populate(const Vector<WebContextMenuItemGtk>&);
+    void populate(const Vector<WebContextMenuItemGlib>&);
     GtkMenu* gtkMenu() const { return m_menu; }
 
 private:
@@ -57,8 +57,8 @@
     WebContextMenuProxyGtk(GtkWidget*, WebPageProxy&, const ContextMenuContextData&, const UserData&);
     void show() override;
     void showContextMenuWithItems(const Vector<WebContextMenuItemData>&) override;
-    void append(GMenu*, const WebContextMenuItemGtk&);
-    GRefPtr<GMenu> buildMenu(const Vector<WebContextMenuItemGtk>&);
+    void append(GMenu*, const WebContextMenuItemGlib&);
+    GRefPtr<GMenu> buildMenu(const Vector<WebContextMenuItemGlib>&);
     void populate(const Vector<RefPtr<WebContextMenuItem>>&);
     static void menuPositionFunction(GtkMenu*, gint*, gint*, gboolean*, WebContextMenuProxyGtk*);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to