| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 384 } |
| 385 | 385 |
| 386 void BrowserPlugin::updateGeometry(const WebRect& plugin_rect_in_viewport, | 386 void BrowserPlugin::updateGeometry(const WebRect& plugin_rect_in_viewport, |
| 387 const WebRect& clip_rect, | 387 const WebRect& clip_rect, |
| 388 const WebRect& unobscured_rect, | 388 const WebRect& unobscured_rect, |
| 389 const WebVector<WebRect>& cut_outs_rects, | 389 const WebVector<WebRect>& cut_outs_rects, |
| 390 bool is_visible) { | 390 bool is_visible) { |
| 391 gfx::Rect old_view_rect = view_rect_; | 391 gfx::Rect old_view_rect = view_rect_; |
| 392 // Convert the plugin_rect_in_viewport to window coordinates, which is css. | 392 // Convert the plugin_rect_in_viewport to window coordinates, which is css. |
| 393 WebRect rect_in_css(plugin_rect_in_viewport); | 393 WebRect rect_in_css(plugin_rect_in_viewport); |
| 394 blink::WebView* webview = container()->document().frame()->view(); | 394 |
| 395 RenderViewImpl::FromWebView(webview)->GetWidget()->convertViewportToWindow( | 395 // We will use the local root's RenderWidget to convert coordinates to Window. |
| 396 &rect_in_css); | 396 // If this local root belongs to an OOPIF, on the browser side we will have to |
| 397 // consider the displacement of the child frame in root window. |
| 398 RenderFrameImpl::FromWebFrame(container()->document().frame()) |
| 399 ->GetRenderWidget() |
| 400 ->convertViewportToWindow(&rect_in_css); |
| 397 view_rect_ = rect_in_css; | 401 view_rect_ = rect_in_css; |
| 398 | 402 |
| 399 if (!ready_) { | 403 if (!ready_) { |
| 400 if (delegate_) | 404 if (delegate_) |
| 401 delegate_->Ready(); | 405 delegate_->Ready(); |
| 402 ready_ = true; | 406 ready_ = true; |
| 403 } | 407 } |
| 404 | 408 |
| 405 bool rect_size_changed = view_rect_.size() != old_view_rect.size(); | 409 bool rect_size_changed = view_rect_.size() != old_view_rect.size(); |
| 406 if (delegate_ && rect_size_changed) | 410 if (delegate_ && rect_size_changed) |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 | 624 |
| 621 bool BrowserPlugin::HandleMouseLockedInputEvent( | 625 bool BrowserPlugin::HandleMouseLockedInputEvent( |
| 622 const blink::WebMouseEvent& event) { | 626 const blink::WebMouseEvent& event) { |
| 623 BrowserPluginManager::Get()->Send( | 627 BrowserPluginManager::Get()->Send( |
| 624 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, | 628 new BrowserPluginHostMsg_HandleInputEvent(browser_plugin_instance_id_, |
| 625 &event)); | 629 &event)); |
| 626 return true; | 630 return true; |
| 627 } | 631 } |
| 628 | 632 |
| 629 } // namespace content | 633 } // namespace content |
| OLD | NEW |