diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h')
-rw-r--r-- | Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h | 49 |
1 files changed, 34 insertions, 15 deletions
diff --git a/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h b/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h index 4b335bcde..c9ceb6988 100644 --- a/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h +++ b/Source/WebKit2/UIProcess/gtk/WebPopupMenuProxyGtk.h @@ -21,11 +21,16 @@ #define WebPopupMenuProxyGtk_h #include "WebPopupMenuProxy.h" -#include <WebCore/GtkPopupMenu.h> -#include <WebCore/IntRect.h> -#include <wtf/gobject/GRefPtr.h> +#include <wtf/RunLoop.h> +#include <wtf/glib/GRefPtr.h> +#include <wtf/text/WTFString.h> typedef struct _GMainLoop GMainLoop; +typedef struct _GdkEventKey GdkEventKey; + +namespace WebCore { +class IntRect; +} namespace WebKit { @@ -33,28 +38,42 @@ class WebPageProxy; class WebPopupMenuProxyGtk : public WebPopupMenuProxy { public: - static PassRefPtr<WebPopupMenuProxyGtk> create(GtkWidget* webView, WebPopupMenuProxy::Client* client) + static Ref<WebPopupMenuProxyGtk> create(GtkWidget* webView, WebPopupMenuProxy::Client& client) { - return adoptRef(new WebPopupMenuProxyGtk(webView, client)); + return adoptRef(*new WebPopupMenuProxyGtk(webView, client)); } ~WebPopupMenuProxyGtk(); - virtual void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex); - virtual void hidePopupMenu(); + void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex) override; + void hidePopupMenu() override; + void cancelTracking() override; private: - WebPopupMenuProxyGtk(GtkWidget*, WebPopupMenuProxy::Client*); - void shutdownRunLoop(); - void setActiveItem(int activeItem) { m_activeItem = activeItem; } + WebPopupMenuProxyGtk(GtkWidget*, WebPopupMenuProxy::Client&); + + void setCurrentlySelectedMenuItem(GtkWidget* item) { m_currentlySelectedMenuItem = item; } GtkAction* createGtkActionForMenuItem(const WebPopupItem&, int itemIndex); + void populatePopupMenu(const Vector<WebPopupItem>&); + void dismissMenuTimerFired(); + + bool typeAheadFind(GdkEventKey*); + void resetTypeAheadFindState(); static void menuItemActivated(GtkAction*, WebPopupMenuProxyGtk*); - static void menuUnmapped(GtkWidget*, WebPopupMenuProxyGtk*); + static void selectItemCallback(GtkWidget*, WebPopupMenuProxyGtk*); + static gboolean keyPressEventCallback(GtkWidget*, GdkEventKey*, WebPopupMenuProxyGtk*); + static void menuUnmappedCallback(GtkWidget*, WebPopupMenuProxyGtk*); + + GtkWidget* m_webView { nullptr }; + GtkWidget* m_popup { nullptr }; + + RunLoop::Timer<WebPopupMenuProxyGtk> m_dismissMenuTimer; - GtkWidget* m_webView; - OwnPtr<WebCore::GtkPopupMenu> m_popup; - int m_activeItem; - GRefPtr<GMainLoop> m_runLoop; + // Typeahead find. + unsigned m_previousKeyEventCharacter { 0 }; + uint32_t m_previousKeyEventTimestamp { 0 }; + GtkWidget* m_currentlySelectedMenuItem { nullptr }; + String m_currentSearchString; }; } // namespace WebKit |