| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 resent_wheel_event.resendingPluginId = browser_plugin_instance_id_; | 478 resent_wheel_event.resendingPluginId = browser_plugin_instance_id_; |
| 479 // TODO(wjmaclean): Initialize latency info correctly for OOPIFs. | 479 // TODO(wjmaclean): Initialize latency info correctly for OOPIFs. |
| 480 // https://crbug.com/613628 | 480 // https://crbug.com/613628 |
| 481 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); | 481 ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL); |
| 482 view->ProcessMouseWheelEvent(resent_wheel_event, latency_info); | 482 view->ProcessMouseWheelEvent(resent_wheel_event, latency_info); |
| 483 } else { | 483 } else { |
| 484 NOTIMPLEMENTED(); | 484 NOTIMPLEMENTED(); |
| 485 } | 485 } |
| 486 } | 486 } |
| 487 | 487 |
| 488 gfx::Point BrowserPluginGuest::GetCoordinatesInEmbedderWebContents( |
| 489 const gfx::Point& relative_point) { |
| 490 RenderWidgetHostView* owner_rwhv = GetOwnerRenderWidgetHostView(); |
| 491 if (!owner_rwhv) |
| 492 return relative_point; |
| 493 |
| 494 gfx::Point point(relative_point); |
| 495 |
| 496 // Add the offset form the embedder web contents view. |
| 497 point += |
| 498 owner_rwhv->TransformPointToRootCoordSpace(guest_window_rect_.origin()) |
| 499 .OffsetFromOrigin(); |
| 500 return point; |
| 501 } |
| 502 |
| 488 WebContentsImpl* BrowserPluginGuest::GetWebContents() const { | 503 WebContentsImpl* BrowserPluginGuest::GetWebContents() const { |
| 489 return static_cast<WebContentsImpl*>(web_contents()); | 504 return static_cast<WebContentsImpl*>(web_contents()); |
| 490 } | 505 } |
| 491 | 506 |
| 492 gfx::Point BrowserPluginGuest::GetScreenCoordinates( | 507 gfx::Point BrowserPluginGuest::GetScreenCoordinates( |
| 493 const gfx::Point& relative_position) const { | 508 const gfx::Point& relative_position) const { |
| 494 if (!attached()) | 509 if (!attached()) |
| 495 return relative_position; | 510 return relative_position; |
| 496 | 511 |
| 497 gfx::Point screen_pos(relative_position); | 512 gfx::Point screen_pos(relative_position); |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 range, character_bounds); | 1071 range, character_bounds); |
| 1057 } | 1072 } |
| 1058 #endif | 1073 #endif |
| 1059 | 1074 |
| 1060 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { | 1075 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { |
| 1061 if (delegate_) | 1076 if (delegate_) |
| 1062 delegate_->SetContextMenuPosition(position); | 1077 delegate_->SetContextMenuPosition(position); |
| 1063 } | 1078 } |
| 1064 | 1079 |
| 1065 } // namespace content | 1080 } // namespace content |
| OLD | NEW |