Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1377)

Unified Diff: Source/web/WebPagePopupImpl.h

Issue 26564006: Cleanup: Add conversion interface for WebWidget derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebHelperPluginImpl.h ('k') | Source/web/WebPopupMenuImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/web/WebHelperPluginImpl.h ('k') | Source/web/WebPopupMenuImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698