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

Unified Diff: Source/web/WebPluginContainerImpl.cpp

Issue 26936002: Remove Widget's dependency upon its own inheritor aka ScrollView. This was nasty from an OO design… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Fix for clang compile error 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/WebPluginContainerImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index 3edb19a841dca103d602ad6776b2002dcf5b9156..713d2c2f71bc179c7952c21e7e989602c51916e2 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -124,7 +124,7 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec
gc->save();
ASSERT(parent()->isFrameView());
- ScrollView* view = parent();
+ ScrollView* view = toScrollView(parent());
// The plugin is positioned in window coordinates, so it needs to be painted
// in window coordinates.
@@ -246,15 +246,15 @@ void WebPluginContainerImpl::setParentVisible(bool parentVisible)
m_webPlugin->updateVisibility(isVisible());
}
-void WebPluginContainerImpl::setParent(ScrollView* view)
+void WebPluginContainerImpl::setParent(Widget* widget)
{
// We override this function so that if the plugin is windowed, we can call
// NPP_SetWindow at the first possible moment. This ensures that
// NPP_SetWindow is called before the manual load data is sent to a plugin.
// If this order is reversed, Flash won't load videos.
- Widget::setParent(view);
- if (view)
+ Widget::setParent(widget);
+ if (widget)
reportGeometry();
}
@@ -523,7 +523,7 @@ void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents)
WebPoint WebPluginContainerImpl::windowToLocalPoint(const WebPoint& point)
{
- ScrollView* view = parent();
+ ScrollView* view = toScrollView(parent());
if (!view)
return point;
WebPoint windowPoint = view->windowToContents(point);
@@ -532,7 +532,7 @@ WebPoint WebPluginContainerImpl::windowToLocalPoint(const WebPoint& point)
WebPoint WebPluginContainerImpl::localToWindowPoint(const WebPoint& point)
{
- ScrollView* view = parent();
+ ScrollView* view = toScrollView(parent());
if (!view)
return point;
IntPoint absolutePoint = roundedIntPoint(m_element->renderer()->localToAbsolute(LayoutPoint(point), UseTransforms));
@@ -866,7 +866,7 @@ void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect,
IntRect& clipRect,
Vector<IntRect>& cutOutRects)
{
- windowRect = parent()->contentsToWindow(frameRect);
+ windowRect = toScrollView(parent())->contentsToWindow(frameRect);
// Calculate a clip-rect so that we don't overlap the scrollbars, etc.
clipRect = windowClipRect();
« no previous file with comments | « Source/web/WebPluginContainerImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698