Index: Source/web/WebPagePopupImpl.h |
diff --git a/Source/web/WebPagePopupImpl.h b/Source/web/WebPagePopupImpl.h |
index a3c1cfb567f0a31f1d09fa7dcbe5633adad60261..74641ff31281b9faaef9dc1006daf3ad8a8a0320 100644 |
--- a/Source/web/WebPagePopupImpl.h |
+++ b/Source/web/WebPagePopupImpl.h |
@@ -73,6 +73,7 @@ private: |
virtual void close() OVERRIDE; |
virtual bool handleInputEvent(const WebInputEvent&) OVERRIDE; |
virtual void setFocus(bool) OVERRIDE; |
+ virtual bool isPagePopup() const OVERRIDE { return true; } |
// PageWidgetEventHandler functions |
virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; |
@@ -95,5 +96,18 @@ private: |
friend class PagePopupChromeClient; |
}; |
+inline WebPagePopupImpl* toWebPagePopupImpl(WebWidget* widget) |
+{ |
+ ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isPagePopup()); |
+ return static_cast<WebPagePopupImpl*>(widget); |
+} |
+ |
+inline WebPagePopupImpl* toWebPagePopupImpl(WebCore::PagePopup* popup) |
+{ |
+ // WebPagePopupImpl is the only implementation of WebCore::PagePopup, so |
+ // no further checking required. |
+ return static_cast<WebPagePopupImpl*>(popup); |
+} |
+ |
} // namespace WebKit |
#endif // WebPagePopupImpl_h |