[GTK] Try to fix the build after r191402.
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Oct 2015 08:08:23 +0000 (08:08 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Oct 2015 08:08:23 +0000 (08:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150435

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-10-22
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy):
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::populate):
(WebKit::WebContextMenuProxyGtk::show):
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
(WebKit::WebContextMenuProxyGtk::menuPositionFunction):
(WebKit::WebContextMenuProxyGtk::showContextMenu): Deleted.
(WebKit::WebContextMenuProxyGtk::hideContextMenu): Deleted.
(WebKit::WebContextMenuProxyGtk::cancelTracking): Deleted.
* UIProcess/gtk/WebContextMenuProxyGtk.h:
(WebKit::WebContextMenuProxyGtk::gtkMenu):
(WebKit::WebContextMenuProxyGtk::create): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191447 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h

index 6cff72d..9b61df2 100644 (file)
@@ -1,3 +1,28 @@
+2015-10-22  Hunseop Jeong  <hs85.jeong@samsung.com>
+
+        [GTK] Try to fix the build after r191402.
+        https://bugs.webkit.org/show_bug.cgi?id=150435
+
+        Reviewed by Carlos Garcia Campos.
+
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::createPopupMenuProxy):
+        (WebKit::PageClientImpl::createContextMenuProxy):
+        (WebKit::PageClientImpl::createColorPicker):
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
+        (WebKit::WebContextMenuProxyGtk::populate):
+        (WebKit::WebContextMenuProxyGtk::show):
+        (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
+        (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
+        (WebKit::WebContextMenuProxyGtk::menuPositionFunction):
+        (WebKit::WebContextMenuProxyGtk::showContextMenu): Deleted.
+        (WebKit::WebContextMenuProxyGtk::hideContextMenu): Deleted.
+        (WebKit::WebContextMenuProxyGtk::cancelTracking): Deleted.
+        * UIProcess/gtk/WebContextMenuProxyGtk.h:
+        (WebKit::WebContextMenuProxyGtk::gtkMenu):
+        (WebKit::WebContextMenuProxyGtk::create): Deleted.
+
 2015-10-21  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
        Unreviewed EFL build fix. Remove customizeMenu implementation.
index 5ddf670..dfcbd92 100644 (file)
@@ -211,9 +211,9 @@ RefPtr<WebPopupMenuProxy> PageClientImpl::createPopupMenuProxy(WebPageProxy& pag
     return WebPopupMenuProxyGtk::create(m_viewWidget, page);
 }
 
-RefPtr<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy& page, const ContextMenuContextData& context, const UserData& userData)
+std::unique_ptr<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPageProxy& page, const ContextMenuContextData& context, const UserData& userData)
 {
-    return WebContextMenuProxyGtk::create(m_viewWidget, page, context, userData);
+    return std::make_unique<WebContextMenuProxyGtk>(m_viewWidget, page, context, userData);
 }
 
 RefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy* page, const WebCore::Color& color, const WebCore::IntRect& rect)
index f67c1cb..61303d7 100644 (file)
@@ -83,7 +83,7 @@ private:
     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) override;
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) override;
     virtual RefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy&) override;
-    virtual RefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy&, const ContextMenuContextData&, const UserData&) override;
+    virtual std::unique_ptr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy&, const ContextMenuContextData&, const UserData&) override;
 #if ENABLE(INPUT_TYPE_COLOR)
     virtual RefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&) override;
 #endif
index 20333b7..3827125 100644 (file)
@@ -141,7 +141,7 @@ void WebContextMenuProxyGtk::populate(const Vector<RefPtr<WebContextMenuItem>>&
     }
 }
 
-void WebContextMenuProxyGtk::showContextMenu()
+void WebContextMenuProxyGtk::show()
 {
     Vector<RefPtr<WebContextMenuItem>> proposedAPIItems;
     for (auto& item : m_context.menuItems()) {
@@ -173,11 +173,6 @@ void WebContextMenuProxyGtk::showContextMenu()
                    event ? event->button.button : 3, event ? event->button.time : GDK_CURRENT_TIME);
 }
 
-void WebContextMenuProxyGtk::hideContextMenu()
-{
-    gtk_menu_popdown(m_menu.platformDescription());
-}
-
 WebContextMenuProxyGtk::WebContextMenuProxyGtk(GtkWidget* webView, WebPageProxy& page, const ContextMenuContextData& context, const UserData& userData)
     : WebContextMenuProxy(context, userData)
     , m_webView(webView)
@@ -188,7 +183,14 @@ WebContextMenuProxyGtk::WebContextMenuProxyGtk(GtkWidget* webView, WebPageProxy&
 
 WebContextMenuProxyGtk::~WebContextMenuProxyGtk()
 {
-    cancelTracking();
+    gtk_menu_popdown(m_menu.platformDescription());
+
+    for (auto& handler : m_signalHandlers)
+        g_signal_handler_disconnect(handler.value, handler.key);
+    m_signalHandlers.clear();
+
+    webkitWebViewBaseSetActiveContextMenuProxy(WEBKIT_WEB_VIEW_BASE(m_webView), nullptr);
+    m_menu.setPlatformDescription(nullptr);
 }
 
 void WebContextMenuProxyGtk::menuPositionFunction(GtkMenu* menu, gint* x, gint* y, gboolean* pushIn, WebContextMenuProxyGtk* popupMenu)
@@ -208,15 +210,5 @@ void WebContextMenuProxyGtk::menuPositionFunction(GtkMenu* menu, gint* x, gint*
     *pushIn = FALSE;
 }
 
-void WebContextMenuProxyGtk::cancelTracking()
-{
-    for (auto iter = m_signalHandlers.begin(); iter != m_signalHandlers.end(); ++iter)
-        g_signal_handler_disconnect(iter->value, iter->key);
-    m_signalHandlers.clear();
-
-    webkitWebViewBaseSetActiveContextMenuProxy(WEBKIT_WEB_VIEW_BASE(m_webView), nullptr);
-    m_menu.setPlatformDescription(nullptr);
-}
-
 } // namespace WebKit
 #endif // ENABLE(CONTEXT_MENUS)
index 2a6bd83..8f3bb8a 100644 (file)
@@ -41,22 +41,14 @@ class WebPageProxy;
 
 class WebContextMenuProxyGtk : public WebContextMenuProxy {
 public:
-    static Ref<WebContextMenuProxyGtk> create(GtkWidget* webView, WebPageProxy& page, const ContextMenuContextData& context, const UserData& userData)
-    {
-        return adoptRef(*new WebContextMenuProxyGtk(webView, page, context, userData));
-    }
+    WebContextMenuProxyGtk(GtkWidget*, WebPageProxy&, const ContextMenuContextData&, const UserData&);
     ~WebContextMenuProxyGtk();
 
-    virtual void showContextMenu() override;
-    virtual void hideContextMenu() override;
-    virtual void cancelTracking() override;
-
     void populate(Vector<WebCore::ContextMenuItem>&);
     GtkMenu* gtkMenu() const { return m_menu.platformDescription(); }
 
 private:
-    WebContextMenuProxyGtk(GtkWidget*, WebPageProxy&, const ContextMenuContextData&, const UserData&);
-
+    virtual void show() override;
     void append(WebCore::ContextMenuItem&);
     void populate(const Vector<RefPtr<WebContextMenuItem>>&);
     static void menuPositionFunction(GtkMenu*, gint*, gint*, gboolean*, WebContextMenuProxyGtk*);