| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "content/renderer/browser_plugin/browser_plugin.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 443 |
| 444 void BrowserPlugin::updateGeometry( | 444 void BrowserPlugin::updateGeometry( |
| 445 const WebRect& window_rect, | 445 const WebRect& window_rect, |
| 446 const WebRect& clip_rect, | 446 const WebRect& clip_rect, |
| 447 const WebVector<WebRect>& cut_outs_rects, | 447 const WebVector<WebRect>& cut_outs_rects, |
| 448 bool is_visible) { | 448 bool is_visible) { |
| 449 int old_width = width(); | 449 int old_width = width(); |
| 450 int old_height = height(); | 450 int old_height = height(); |
| 451 plugin_rect_ = window_rect; | 451 plugin_rect_ = window_rect; |
| 452 if (!ready_) { | 452 if (!ready_) { |
| 453 if (delegate_) | 453 if (delegate_) { |
| 454 delegate_->OnElementResize(gfx::Size(), plugin_size()); |
| 454 delegate_->Ready(); | 455 delegate_->Ready(); |
| 456 } |
| 455 ready_ = true; | 457 ready_ = true; |
| 456 } | 458 } |
| 457 if (!attached()) | 459 if (!attached()) |
| 458 return; | 460 return; |
| 459 | 461 |
| 460 if (old_width == window_rect.width && old_height == window_rect.height) { | 462 if (old_width == window_rect.width && old_height == window_rect.height) { |
| 461 // Let the browser know about the updated view rect. | 463 // Let the browser know about the updated view rect. |
| 462 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateGeometry( | 464 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_UpdateGeometry( |
| 463 render_view_routing_id_, browser_plugin_instance_id_, plugin_rect_)); | 465 render_view_routing_id_, browser_plugin_instance_id_, plugin_rect_)); |
| 464 return; | 466 return; |
| 465 } | 467 } |
| 466 | 468 |
| 469 if (delegate_) |
| 470 delegate_->OnElementResize(gfx::Size(old_width, old_height), plugin_size()); |
| 471 |
| 467 BrowserPluginHostMsg_ResizeGuest_Params params; | 472 BrowserPluginHostMsg_ResizeGuest_Params params; |
| 468 PopulateResizeGuestParameters(plugin_size(), ¶ms); | 473 PopulateResizeGuestParameters(plugin_size(), ¶ms); |
| 469 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ResizeGuest( | 474 BrowserPluginManager::Get()->Send(new BrowserPluginHostMsg_ResizeGuest( |
| 470 render_view_routing_id_, | 475 render_view_routing_id_, |
| 471 browser_plugin_instance_id_, | 476 browser_plugin_instance_id_, |
| 472 params)); | 477 params)); |
| 473 } | 478 } |
| 474 | 479 |
| 475 void BrowserPlugin::PopulateResizeGuestParameters( | 480 void BrowserPlugin::PopulateResizeGuestParameters( |
| 476 const gfx::Size& view_size, | 481 const gfx::Size& view_size, |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 const blink::WebMouseEvent& event) { | 671 const blink::WebMouseEvent& event) { |
| 667 BrowserPluginManager::Get()->Send( | 672 BrowserPluginManager::Get()->Send( |
| 668 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, | 673 new BrowserPluginHostMsg_HandleInputEvent(render_view_routing_id_, |
| 669 browser_plugin_instance_id_, | 674 browser_plugin_instance_id_, |
| 670 plugin_rect_, | 675 plugin_rect_, |
| 671 &event)); | 676 &event)); |
| 672 return true; | 677 return true; |
| 673 } | 678 } |
| 674 | 679 |
| 675 } // namespace content | 680 } // namespace content |
| OLD | NEW |