WebPagePopupImpl.h [plain text]
#ifndef WebPagePopupImpl_h
#define WebPagePopupImpl_h
#if ENABLE(PAGE_POPUP)
#include "PagePopup.h"
#include "PageWidgetDelegate.h"
#include "WebPagePopup.h"
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
class Page;
class PagePopupClient;
class PlatformKeyboardEvent;
}
namespace WebKit {
class PagePopupChromeClient;
class WebViewImpl;
class WebPagePopupImpl : public WebPagePopup,
public PageWidgetEventHandler,
public WebCore::PagePopup,
public RefCounted<WebPagePopupImpl> {
WTF_MAKE_NONCOPYABLE(WebPagePopupImpl);
WTF_MAKE_FAST_ALLOCATED;
public:
virtual ~WebPagePopupImpl();
bool init(WebViewImpl*, WebCore::PagePopupClient*, const WebCore::IntRect& originBoundsInRootView);
bool handleKeyEvent(const WebCore::PlatformKeyboardEvent&);
void closePopup();
WebWidgetClient* widgetClient() const { return m_widgetClient; }
private:
virtual WebSize size() OVERRIDE;
virtual void animate(double) OVERRIDE;
virtual void setCompositorSurfaceReady() OVERRIDE;
virtual void composite(bool) OVERRIDE;
virtual void layout() OVERRIDE;
virtual void paint(WebCanvas*, const WebRect&) OVERRIDE;
virtual void resize(const WebSize&) OVERRIDE;
virtual void close() OVERRIDE;
virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE;
virtual void setFocus(bool) OVERRIDE;
virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE;
virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE;
#if ENABLE(GESTURE_EVENTS)
virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE;
#endif
explicit WebPagePopupImpl(WebWidgetClient*);
bool initPage();
WebWidgetClient* m_widgetClient;
WebRect m_windowRectInScreen;
WebViewImpl* m_webView;
OwnPtr<WebCore::Page> m_page;
OwnPtr<PagePopupChromeClient> m_chromeClient;
WebCore::PagePopupClient* m_popupClient;
bool m_isPutAboveOrigin;
friend class WebPagePopup;
friend class PagePopupChromeClient;
};
} #endif // ENABLE(PAGE_POPUP)
#endif // WebPagePopupImpl_h