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

Unified Diff: Source/web/WebPopupMenuImpl.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/WebPagePopupImpl.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPopupMenuImpl.h
diff --git a/Source/web/WebPopupMenuImpl.h b/Source/web/WebPopupMenuImpl.h
index f2decbb1b550a02fc0a1caf7e14b6504752a3931..29df9d17b58ac5cff37fed528aad3dad9b842c89 100644
--- a/Source/web/WebPopupMenuImpl.h
+++ b/Source/web/WebPopupMenuImpl.h
@@ -86,6 +86,7 @@ public:
virtual bool caretOrSelectionRange(size_t* location, size_t* length) OVERRIDE;
virtual void setTextDirection(WebTextDirection) OVERRIDE;
virtual bool isAcceleratedCompositingActive() const OVERRIDE { return false; }
+ virtual bool isPopupMenu() const OVERRIDE { return true; }
// WebPopupMenuImpl
void initialize(WebCore::FramelessScrollView* widget, const WebRect& bounds);
@@ -134,6 +135,19 @@ public:
WebCore::FramelessScrollView* m_widget;
};
+inline WebPopupMenuImpl* toWebPopupMenuImpl(WebWidget* widget)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isPopupMenu());
+ return static_cast<WebPopupMenuImpl*>(widget);
+}
+
+inline WebPopupMenuImpl* toWebPopupMenuImpl(WebCore::FramelessScrollViewClient* client)
+{
+ // WebPopupMenuImpl is the only implementation of FramelessScrollViewClient,
+ // so no need for further checking.
+ return static_cast<WebPopupMenuImpl*>(client);
+}
+
} // namespace WebKit
#endif
« no previous file with comments | « Source/web/WebPagePopupImpl.h ('k') | Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698