[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:39:11 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 6d7e32e8371fbada1531424f943ff3def553c0bc
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 16 23:52:38 2009 +0000

    2009-12-16  Luiz Agostini  <luiz.agostini at openbossa.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Implement combobox delegate for Qt
            https://bugs.webkit.org/show_bug.cgi?id=32550
    
            Abstract popup menu factory.
    
            A static method from QtAbstractPopupMenu is used to create its instances. If a factory
            has been suplied to class QtAbstractPopupMenu the factory will be used to create the
            objects. If not an instance of QtFallbackPopupMenu will be created.
    
            The objective is to make it easy to replace the combobox popup at WebCore layer providing
            support to the combobox popup delegation API. Future patches will make it possible to
            replace the combobox popup at WebKit layer.
    
            No behavior changes.
    
            * platform/qt/PopupMenuQt.cpp:
            (WebCore::PopupMenu::PopupMenu):
            * platform/qt/QtAbstractWebPopup.cpp:
            (WebCore::QtAbstractWebPopup::setFactory):
            (WebCore::QtAbstractWebPopup::create):
            * platform/qt/QtAbstractWebPopup.h:
            * platform/qt/QtFallbackWebPopup.cpp:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52223 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cbad9d1..1968a1d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2009-12-16  Luiz Agostini  <luiz.agostini at openbossa.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Implement combobox delegate for Qt
+        https://bugs.webkit.org/show_bug.cgi?id=32550
+
+        Abstract popup menu factory.
+
+        A static method from QtAbstractPopupMenu is used to create its instances. If a factory
+        has been suplied to class QtAbstractPopupMenu the factory will be used to create the
+        objects. If not an instance of QtFallbackPopupMenu will be created.
+
+        The objective is to make it easy to replace the combobox popup at WebCore layer providing
+        support to the combobox popup delegation API. Future patches will make it possible to
+        replace the combobox popup at WebKit layer.
+
+        No behavior changes.
+
+        * platform/qt/PopupMenuQt.cpp:
+        (WebCore::PopupMenu::PopupMenu):
+        * platform/qt/QtAbstractWebPopup.cpp:
+        (WebCore::QtAbstractWebPopup::setFactory):
+        (WebCore::QtAbstractWebPopup::create):
+        * platform/qt/QtAbstractWebPopup.h:
+        * platform/qt/QtFallbackWebPopup.cpp:
+
 2009-12-16  Mark Rowe  <mrowe at apple.com>
 
         Build fix.  Disable debug variants of WebKit frameworks.
diff --git a/WebCore/platform/qt/PopupMenuQt.cpp b/WebCore/platform/qt/PopupMenuQt.cpp
index bae27e6..498ef7b 100644
--- a/WebCore/platform/qt/PopupMenuQt.cpp
+++ b/WebCore/platform/qt/PopupMenuQt.cpp
@@ -36,7 +36,7 @@ namespace WebCore {
 PopupMenu::PopupMenu(PopupMenuClient* client)
     : m_popupClient(client)
 {
-    m_popup = new QtFallbackWebPopup(client);
+    m_popup = QtAbstractWebPopup::create(client);
 }
 
 PopupMenu::~PopupMenu()
diff --git a/WebCore/platform/qt/QtAbstractWebPopup.cpp b/WebCore/platform/qt/QtAbstractWebPopup.cpp
index b16c6cb..cbe7174 100644
--- a/WebCore/platform/qt/QtAbstractWebPopup.cpp
+++ b/WebCore/platform/qt/QtAbstractWebPopup.cpp
@@ -20,12 +20,13 @@
 #include "config.h"
 #include "QtAbstractWebPopup.h"
 
-#include "PopupMenuStyle.h"
+#include "PopupMenuClient.h"
+#include "QtFallbackWebPopup.h"
 
 
 namespace WebCore {
 
-// QAbstractWebPopup
+QtAbstractWebPopupFactory* QtAbstractWebPopup::m_factory = 0;
 
 QtAbstractWebPopup::QtAbstractWebPopup(PopupMenuClient* client)
     : m_client(client)
@@ -42,4 +43,14 @@ PopupMenuClient* QtAbstractWebPopup::client()
     return m_client;
 }
 
+void QtAbstractWebPopup::setFactory(QtAbstractWebPopupFactory* factory)
+{
+    m_factory = factory;
+}
+
+QtAbstractWebPopup* QtAbstractWebPopup::create(PopupMenuClient* client)
+{
+    return m_factory ? m_factory->create(client) : new QtFallbackWebPopup(client);
+}
+
 } // namespace WebCore
diff --git a/WebCore/platform/qt/QtAbstractWebPopup.h b/WebCore/platform/qt/QtAbstractWebPopup.h
index 3131e55..b8cab4a 100644
--- a/WebCore/platform/qt/QtAbstractWebPopup.h
+++ b/WebCore/platform/qt/QtAbstractWebPopup.h
@@ -20,11 +20,18 @@
 #ifndef QtAbstractWebPopup_h
 #define QtAbstractWebPopup_h
 
-#include "PopupMenuClient.h"
-#include <QComboBox>
+#include <QRect>
 
 namespace WebCore {
 
+class QtAbstractWebPopup;
+class PopupMenuClient;
+
+class QtAbstractWebPopupFactory {
+public:
+    virtual QtAbstractWebPopup* create(PopupMenuClient* client) = 0;
+};
+
 class QtAbstractWebPopup {
 public:
     QtAbstractWebPopup(PopupMenuClient* client);
@@ -33,11 +40,15 @@ public:
     virtual void show(const QRect& geometry, int selectedIndex) = 0;
     virtual void hide() = 0;
 
+    static void setFactory(QtAbstractWebPopupFactory* factory);
+    static QtAbstractWebPopup* create(PopupMenuClient* client);
+
 protected:
     PopupMenuClient* client();
 
 private:
     PopupMenuClient* m_client;
+    static QtAbstractWebPopupFactory* m_factory;
 };
 
 }
diff --git a/WebCore/platform/qt/QtFallbackWebPopup.cpp b/WebCore/platform/qt/QtFallbackWebPopup.cpp
index cf7cbb8..006d06a 100644
--- a/WebCore/platform/qt/QtFallbackWebPopup.cpp
+++ b/WebCore/platform/qt/QtFallbackWebPopup.cpp
@@ -21,6 +21,7 @@
 #include "QtFallbackWebPopup.h"
 
 #include "HostWindow.h"
+#include "PopupMenuClient.h"
 #include "QWebPageClient.h"
 #include <QAbstractItemView>
 #include <QApplication>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list