diff options
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 15 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.h | 2 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 13 |
3 files changed, 17 insertions, 13 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index a400d39..daf58b5 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -157,7 +157,7 @@ WebPluginDelegateProxy::WebPluginDelegateProxy( const base::WeakPtr<RenderView>& render_view) : render_view_(render_view), plugin_(NULL), - windowless_(false), + uses_shared_bitmaps_(false), window_(gfx::kNullPluginWindow), mime_type_(mime_type), instance_id_(MSG_ROUTING_NONE), @@ -457,7 +457,7 @@ void WebPluginDelegateProxy::UpdateGeometry(const gfx::Rect& window_rect, param.ack_key = -1; #endif - if (windowless_) { + if (uses_shared_bitmaps_) { if (!backing_store_canvas_.get() || (window_rect.width() != backing_store_canvas_->getDevice()->width() || window_rect.height() != backing_store_canvas_->getDevice()->height())) @@ -623,8 +623,7 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas, return; } - // No paint events for windowed plugins. - if (!windowless_) + if (!uses_shared_bitmaps_) return; // We got a paint before the plugin's coordinates, so there's no buffer to @@ -929,7 +928,7 @@ void WebPluginDelegateProxy::WindowFrameChanged(gfx::Rect window_frame, #endif // OS_MACOSX void WebPluginDelegateProxy::OnSetWindow(gfx::PluginWindowHandle window) { - windowless_ = !window; + uses_shared_bitmaps_ = !window; window_ = window; if (plugin_) plugin_->SetWindow(window); @@ -1290,6 +1289,12 @@ bool WebPluginDelegateProxy::BindFakePluginWindowHandle() { geom.rects_valid = true; geom.visible = true; render_view_->DidMovePlugin(geom); + // Invalidate the plugin region to ensure that the move event actually gets + // dispatched (for a plugin on an otherwise static page). + render_view_->didInvalidateRect(WebKit::WebRect(plugin_rect_.x(), + plugin_rect_.y(), + plugin_rect_.width(), + plugin_rect_.height())); return true; } diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h index fbc7779..72e36bc 100644 --- a/chrome/renderer/webplugin_delegate_proxy.h +++ b/chrome/renderer/webplugin_delegate_proxy.h @@ -215,7 +215,7 @@ class WebPluginDelegateProxy base::WeakPtr<RenderView> render_view_; webkit_glue::WebPlugin* plugin_; - bool windowless_; + bool uses_shared_bitmaps_; gfx::PluginWindowHandle window_; scoped_refptr<PluginChannelHost> channel_host_; std::string mime_type_; diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 19815b9..08995ee 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -301,12 +301,17 @@ void WebPluginDelegateImpl::PlatformInitialize() { // point, so we just set the initial state directly. container_is_visible_ = true; + // Let the WebPlugin know that we are windowless (unless this is a + // Core Animation plugin, in which case BindFakePluginWindowHandle will take + // care of setting up the appropriate window handle). + if (instance()->drawing_model() != NPDrawingModelCoreAnimation) + plugin_->SetWindow(NULL); + #ifndef NP_NO_CARBON // If the plugin wants Carbon events, hook up to the source of idle events. if (instance()->event_model() == NPEventModelCarbon) UpdateIdleEventRate(); #endif - plugin_->SetWindow(NULL); // QuickTime can crash if it gets other calls (e.g., NPP_Write) before it // gets a SetWindow call, so call SetWindow (with a 0x0 rect) immediately. @@ -443,12 +448,6 @@ void WebPluginDelegateImpl::DrawLayerInSurface() { void WebPluginDelegateImpl::WindowlessPaint(gfx::NativeDrawingContext context, const gfx::Rect& damage_rect) { - // There is currently nothing to do for the Core Animation drawing model, - // but there have been discussions on the plugin-futures mailing list that - // might require future work. - if (instance()->drawing_model() == NPDrawingModelCoreAnimation) - return; - // If we somehow get a paint before we've set up the plugin buffer, bail. if (!buffer_context_) return; |