X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fweb%2FPopupContainer.h;h=d136ad45dba2a1a805eec88e41fe3ad376466566;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=1f10a37f614d0ae6b08006301f8a7a0c22d54660;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/web/PopupContainer.h b/src/third_party/WebKit/Source/web/PopupContainer.h index 1f10a37..d136ad4 100644 --- a/src/third_party/WebKit/Source/web/PopupContainer.h +++ b/src/third_party/WebKit/Source/web/PopupContainer.h @@ -34,36 +34,47 @@ #include "platform/PopupMenuStyle.h" #include "platform/geometry/FloatQuad.h" -#include "platform/scroll/FramelessScrollView.h" #include "web/PopupListBox.h" namespace blink { class ChromeClient; class FrameView; +class PopupContainerClient; class PopupMenuClient; struct WebPopupMenuInfo; -class PopupContainer FINAL : public FramelessScrollView { +// This class wraps a PopupListBox. It positions the popup, paints the border +// around it, and forwards input events. +// FIXME(skobes): This class can probably be combined with PopupListBox. +class PopupContainer FINAL : public Widget { public: static PassRefPtr create(PopupMenuClient*, bool deviceSupportsTouch); // Whether a key event should be sent to this popup. bool isInterestedInEventForKey(int keyCode); - // FramelessScrollView + // Widget virtual void paint(GraphicsContext*, const IntRect&) OVERRIDE; virtual void hide() OVERRIDE; - virtual bool handleMouseDownEvent(const PlatformMouseEvent&) OVERRIDE; - virtual bool handleMouseMoveEvent(const PlatformMouseEvent&) OVERRIDE; - virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&) OVERRIDE; - virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE; - virtual bool handleKeyEvent(const PlatformKeyboardEvent&) OVERRIDE; - virtual bool handleTouchEvent(const PlatformTouchEvent&) OVERRIDE; - virtual bool handleGestureEvent(const PlatformGestureEvent&) OVERRIDE; + virtual HostWindow* hostWindow() const OVERRIDE; + virtual void invalidateRect(const IntRect&) OVERRIDE; + virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint&) const OVERRIDE; + virtual IntPoint convertSelfToChild(const Widget* child, const IntPoint&) const OVERRIDE; // PopupContainer methods + bool handleMouseDownEvent(const PlatformMouseEvent&); + bool handleMouseMoveEvent(const PlatformMouseEvent&); + bool handleMouseReleaseEvent(const PlatformMouseEvent&); + bool handleWheelEvent(const PlatformWheelEvent&); + bool handleKeyEvent(const PlatformKeyboardEvent&); + bool handleTouchEvent(const PlatformTouchEvent&); + bool handleGestureEvent(const PlatformGestureEvent&); + + PopupContainerClient* client() const { return m_client; } + void setClient(PopupContainerClient* client) { m_client = client; } + // Show the popup void showPopup(FrameView*); @@ -109,6 +120,10 @@ public: // This is public for testing. static IntRect layoutAndCalculateWidgetRectInternal(IntRect widgetRectInScreen, int targetControlHeight, const FloatRect& windowRect, const FloatRect& screen, bool isRTL, const int rtlOffset, const int verticalOffset, const IntSize& transformOffset, PopupContent*, bool& needToResizeView); + void disconnectClient() { m_listBox->disconnectClient(); } + + void updateFromElement() { m_listBox->updateFromElement(); } + private: friend class WTF::RefCounted; @@ -149,6 +164,8 @@ private: // Whether the popup is currently open. bool m_popupOpen; + + PopupContainerClient* m_client; }; } // namespace blink