| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/webplugin_delegate_proxy.h" | 5 #include "chrome/renderer/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 | 8 |
| 9 #include "generated_resources.h" | 9 #include "generated_resources.h" |
| 10 | 10 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 render_view_->PluginDestroyed(this); | 176 render_view_->PluginDestroyed(this); |
| 177 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 177 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void WebPluginDelegateProxy::FlushGeometryUpdates() { | 180 void WebPluginDelegateProxy::FlushGeometryUpdates() { |
| 181 if (send_deferred_update_geometry_) { | 181 if (send_deferred_update_geometry_) { |
| 182 send_deferred_update_geometry_ = false; | 182 send_deferred_update_geometry_ = false; |
| 183 Send(new PluginMsg_UpdateGeometry(instance_id_, | 183 Send(new PluginMsg_UpdateGeometry(instance_id_, |
| 184 plugin_rect_, | 184 plugin_rect_, |
| 185 deferred_clip_rect_, | 185 deferred_clip_rect_, |
| 186 deferred_cutout_rects_, |
| 186 visible_, | 187 visible_, |
| 187 NULL, | 188 NULL, |
| 188 NULL)); | 189 NULL)); |
| 189 } | 190 } |
| 190 } | 191 } |
| 191 | 192 |
| 192 bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn, | 193 bool WebPluginDelegateProxy::Initialize(const GURL& url, char** argn, |
| 193 char** argv, int argc, | 194 char** argv, int argc, |
| 194 WebPlugin* plugin, | 195 WebPlugin* plugin, |
| 195 bool load_manually) { | 196 bool load_manually) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 IPC_MESSAGE_UNHANDLED_ERROR() | 327 IPC_MESSAGE_UNHANDLED_ERROR() |
| 327 IPC_END_MESSAGE_MAP() | 328 IPC_END_MESSAGE_MAP() |
| 328 } | 329 } |
| 329 | 330 |
| 330 void WebPluginDelegateProxy::OnChannelError() { | 331 void WebPluginDelegateProxy::OnChannelError() { |
| 331 if (plugin_) | 332 if (plugin_) |
| 332 plugin_->Invalidate(); | 333 plugin_->Invalidate(); |
| 333 render_view_->PluginCrashed(plugin_path_); | 334 render_view_->PluginCrashed(plugin_path_); |
| 334 } | 335 } |
| 335 | 336 |
| 336 void WebPluginDelegateProxy::UpdateGeometry(const gfx::Rect& window_rect, | 337 void WebPluginDelegateProxy::UpdateGeometry( |
| 337 const gfx::Rect& clip_rect, | 338 const gfx::Rect& window_rect, |
| 338 bool visible) { | 339 const gfx::Rect& clip_rect, |
| 340 const std::vector<gfx::Rect>& cutout_rects, |
| 341 bool visible) { |
| 339 plugin_rect_ = window_rect; | 342 plugin_rect_ = window_rect; |
| 340 if (!windowless_) { | 343 if (!windowless_) { |
| 341 deferred_clip_rect_ = clip_rect; | 344 deferred_clip_rect_ = clip_rect; |
| 345 deferred_cutout_rects_ = cutout_rects; |
| 342 visible_ = visible; | 346 visible_ = visible; |
| 343 send_deferred_update_geometry_ = true; | 347 send_deferred_update_geometry_ = true; |
| 344 return; | 348 return; |
| 345 } | 349 } |
| 346 | 350 |
| 347 HANDLE transport_store_handle = NULL; | 351 HANDLE transport_store_handle = NULL; |
| 348 HANDLE background_store_handle = NULL; | 352 HANDLE background_store_handle = NULL; |
| 349 if (!backing_store_canvas_.get() || | 353 if (!backing_store_canvas_.get() || |
| 350 (window_rect.width() != backing_store_canvas_->getDevice()->width() || | 354 (window_rect.width() != backing_store_canvas_->getDevice()->width() || |
| 351 window_rect.height() != backing_store_canvas_->getDevice()->height())) { | 355 window_rect.height() != backing_store_canvas_->getDevice()->height())) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 362 return; | 366 return; |
| 363 } | 367 } |
| 364 | 368 |
| 365 transport_store_handle = transport_store_->handle(); | 369 transport_store_handle = transport_store_->handle(); |
| 366 if (background_store_.get()) | 370 if (background_store_.get()) |
| 367 background_store_handle = background_store_->handle(); | 371 background_store_handle = background_store_->handle(); |
| 368 } | 372 } |
| 369 } | 373 } |
| 370 | 374 |
| 371 IPC::Message* msg = new PluginMsg_UpdateGeometry( | 375 IPC::Message* msg = new PluginMsg_UpdateGeometry( |
| 372 instance_id_, window_rect, clip_rect, visible, transport_store_handle, | 376 instance_id_, window_rect, clip_rect, cutout_rects, visible, |
| 373 background_store_handle); | 377 transport_store_handle, background_store_handle); |
| 374 msg->set_unblock(true); | 378 msg->set_unblock(true); |
| 375 Send(msg); | 379 Send(msg); |
| 376 } | 380 } |
| 377 | 381 |
| 378 // Copied from render_widget.cc | 382 // Copied from render_widget.cc |
| 379 static size_t GetPaintBufSize(const gfx::Rect& rect) { | 383 static size_t GetPaintBufSize(const gfx::Rect& rect) { |
| 380 // TODO(darin): protect against overflow | 384 // TODO(darin): protect against overflow |
| 381 return 4 * rect.width() * rect.height(); | 385 return 4 * rect.width() * rect.height(); |
| 382 } | 386 } |
| 383 | 387 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 plugin_->CancelDocumentLoad(); | 737 plugin_->CancelDocumentLoad(); |
| 734 } | 738 } |
| 735 | 739 |
| 736 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( | 740 void WebPluginDelegateProxy::OnInitiateHTTPRangeRequest( |
| 737 const std::string& url, const std::string& range_info, | 741 const std::string& url, const std::string& range_info, |
| 738 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { | 742 HANDLE existing_stream, bool notify_needed, HANDLE notify_data) { |
| 739 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), | 743 plugin_->InitiateHTTPRangeRequest(url.c_str(), range_info.c_str(), |
| 740 existing_stream, notify_needed, | 744 existing_stream, notify_needed, |
| 741 notify_data); | 745 notify_data); |
| 742 } | 746 } |
| OLD | NEW |