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

Unified Diff: Source/web/WebPagePopupImpl.h

Issue 26434002: Cleanup: Add more conversion helpers for usage. (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
Index: Source/web/WebPagePopupImpl.h
diff --git a/Source/web/WebPagePopupImpl.h b/Source/web/WebPagePopupImpl.h
index a3c1cfb567f0a31f1d09fa7dcbe5633adad60261..a3fe4913a23ab5241da815a7ca2f90a078362cf2 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() OVERRIDE { return true; }
// PageWidgetEventHandler functions
virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE;
@@ -95,5 +96,17 @@ private:
friend class PagePopupChromeClient;
};
+inline WebPagePopupImpl* toWebPagePopupImpl(WebWidget* widget)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(widget && widget->isPagePopup());
tkent 2013/10/08 05:24:04 should accept null widget for consistency.
+ return static_cast<WebPagePopupImpl*>(widget);
+}
+
+inline WebPagePopupImpl* toWebPagePopupImpl(WebCore::PagePopup* popup)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!popup);
tkent 2013/10/08 05:24:04 Null pointer has no security implication. should a
+ return static_cast<WebPagePopupImpl*>(popup);
+}
+
} // namespace WebKit
#endif // WebPagePopupImpl_h

Powered by Google App Engine
This is Rietveld 408576698