diff options
author | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 18:48:28 +0000 |
---|---|---|
committer | dglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 18:48:28 +0000 |
commit | 074ff16d3029256a9585529cad5487c1ae6eb409 (patch) | |
tree | e4d57cd79c533507a632ebf70c8ea8850113a9fc /webkit/glue/webplugin_impl.cc | |
parent | 332ff119039b7dd3ba3d1994dde0b077f015bc03 (diff) | |
download | chromium_src-074ff16d3029256a9585529cad5487c1ae6eb409.zip chromium_src-074ff16d3029256a9585529cad5487c1ae6eb409.tar.gz chromium_src-074ff16d3029256a9585529cad5487c1ae6eb409.tar.bz2 |
Landing 36102:37604 merge on trunk
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webplugin_impl.cc')
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 36d7fc6..0251409 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -118,10 +118,6 @@ NPObject* WebPluginContainer::GetPluginScriptableObject() { return impl_->GetPluginScriptableObject(); } -WebCore::IntRect WebPluginContainer::windowClipRect() const { - return impl_->windowClipRect(); -} - #if USE(JSC) bool WebPluginContainer::isPluginView() const { return true; @@ -129,13 +125,9 @@ bool WebPluginContainer::isPluginView() const { #endif -void WebPluginContainer::geometryChanged() const { - impl_->geometryChanged(); -} - -void WebPluginContainer::setFrameGeometry(const WebCore::IntRect& rect) { - WebCore::Widget::setFrameGeometry(rect); - impl_->setFrameGeometry(rect); +void WebPluginContainer::setFrameRect(const WebCore::IntRect& rect) { + WebCore::Widget::setFrameRect(rect); + impl_->setFrameRect(rect); } void WebPluginContainer::paint(WebCore::GraphicsContext* gc, @@ -146,6 +138,18 @@ void WebPluginContainer::paint(WebCore::GraphicsContext* gc, impl_->paint(gc, damage_rect); } +void WebPluginContainer::invalidateRect(const WebCore::IntRect& rect) { + if (parent()) { + WebCore::IntRect damageRect = convertToContainingWindow(rect); + + // Get our clip rect and intersect with it to ensure we don't invalidate too much. + WebCore::IntRect clipRect = parent()->windowClipRect(); + damageRect.intersect(clipRect); + + parent()->hostWindow()->repaint(damageRect, true); + } +} + void WebPluginContainer::setFocus() { WebCore::Widget::setFocus(); impl_->setFocus(); @@ -164,7 +168,7 @@ void WebPluginContainer::show() { WebCore::Widget::show(); // This is to force an updategeometry call to the plugin process // where the plugin window can be hidden or shown. - geometryChanged(); + frameRectsChanged(); } } @@ -176,7 +180,7 @@ void WebPluginContainer::hide() { WebCore::Widget::hide(); // This is to force an updategeometry call to the plugin process // where the plugin window can be hidden or shown. - geometryChanged(); + frameRectsChanged(); } } @@ -184,16 +188,6 @@ void WebPluginContainer::handleEvent(WebCore::Event* event) { impl_->handleEvent(event); } -void WebPluginContainer::attachToWindow() { - Widget::attachToWindow(); - show(); -} - -void WebPluginContainer::detachFromWindow() { - Widget::detachFromWindow(); - hide(); -} - void WebPluginContainer::windowCutoutRects(const WebCore::IntRect& bounds, WTF::Vector<WebCore::IntRect>* cutouts) const { @@ -602,11 +596,11 @@ void WebPluginImpl::geometryChanged() const { // This is a hack to tickle re-positioning of the plugin in the case where // our parent view was scrolled. - const_cast<WebPluginImpl*>(this)->widget_->setFrameGeometry( - widget_->frameGeometry()); + const_cast<WebPluginImpl*>(this)->widget_->setFrameRect( + widget_->frameRect()); } -void WebPluginImpl::setFrameGeometry(const WebCore::IntRect& rect) { +void WebPluginImpl::setFrameRect(const WebCore::IntRect& rect) { // Compute a new position and clip rect for ourselves relative to the // containing window. We ask our delegate to reposition us accordingly. @@ -679,7 +673,7 @@ void WebPluginImpl::paint(WebCore::GraphicsContext* gc, return; // Don't paint anything if the plugin doesn't intersect the damage rect. - if (!widget_->frameGeometry().intersects(damage_rect)) + if (!widget_->frameRect().intersects(damage_rect)) return; // A windowed plugin starts out by being invisible regardless of the style @@ -697,7 +691,7 @@ void WebPluginImpl::paint(WebCore::GraphicsContext* gc, WebCore::IntRect clip_rect; std::vector<gfx::Rect> cutout_rects; - CalculateBounds(widget_->frameGeometry(), &window_rect, &clip_rect, + CalculateBounds(widget_->frameRect(), &window_rect, &clip_rect, &cutout_rects); delegate_->UpdateGeometry(webkit_glue::FromIntRect(window_rect), @@ -1111,7 +1105,7 @@ void WebPluginImpl::CalculateBounds(const WebCore::IntRect& frame_rect, WebCore::IntRect(view->contentsToWindow(frame_rect.location()), frame_rect.size()); // Calculate a clip-rect so that we don't overlap the scrollbars, etc. - *clip_rect = widget_->windowClipRect(); + *clip_rect = windowClipRect(); clip_rect->move(-window_rect->x(), -window_rect->y()); cutout_rects->clear(); |