Commit 8da2caf6 authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

Remove BrowserPluginGuest::ResendEventToEmbedder

BrowserPlugin is being removed, so this event resending code is dead.

Bug: 533069
Change-Id: Ieb5d2e14671621dcb1d85646f3d12887f8c3d68f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951332Reviewed-by: default avatarJames MacLean <wjmaclean@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721719}
parent fe055c56
......@@ -352,16 +352,6 @@ class ChromeSitePerProcessPDFTest : public ChromeSitePerProcessTest {
return test_guest_view_manager_;
}
void ResendGestureToEmbedder(const std::string& host_name) {
content::WebContents* guest_web_contents = SetupGuestWebContents(host_name);
blink::WebGestureEvent event(blink::WebInputEvent::kGestureScrollUpdate,
blink::WebInputEvent::kNoModifiers,
ui::EventTimeForNow(),
blink::WebGestureDevice::kTouchscreen);
// This should not crash.
content::ResendGestureScrollUpdateToEmbedder(guest_web_contents, event);
}
private:
content::WebContents* SetupGuestWebContents(const std::string& host_name) {
// Navigate to a page with an <iframe>.
......
......@@ -377,48 +377,6 @@ void BrowserPluginGuest::PointerLockPermissionResponse(bool allow) {
browser_plugin_instance_id(), allow));
}
void BrowserPluginGuest::ResendEventToEmbedder(
const blink::WebInputEvent& event) {
if (!attached() || !owner_web_contents_)
return;
DCHECK(browser_plugin_instance_id_);
RenderWidgetHostViewBase* view =
static_cast<RenderWidgetHostViewBase*>(GetOwnerRenderWidgetHostView());
gfx::Vector2d offset_from_embedder = frame_rect_.OffsetFromOrigin();
if (event.GetType() == blink::WebInputEvent::kGestureScrollUpdate) {
blink::WebGestureEvent resent_gesture_event;
memcpy(&resent_gesture_event, &event, sizeof(blink::WebGestureEvent));
resent_gesture_event.SetPositionInWidget(
resent_gesture_event.PositionInWidget() + offset_from_embedder);
// Mark the resend source with the browser plugin's instance id, so the
// correct browser_plugin will know to ignore the event.
resent_gesture_event.resending_plugin_id = browser_plugin_instance_id_;
ui::LatencyInfo latency_info =
ui::WebInputEventTraits::CreateLatencyInfoForWebGestureEvent(
resent_gesture_event);
// The touch action may not be set for the embedder because the
// GestureScrollBegin is sent to the guest view. In this case, set the touch
// action of the embedder to Auto to prevent crash.
GetOwnerRenderWidgetHost()->input_router()->ForceSetTouchActionAuto();
view->ProcessGestureEvent(resent_gesture_event, latency_info);
} else if (event.GetType() == blink::WebInputEvent::kMouseWheel) {
blink::WebMouseWheelEvent resent_wheel_event;
memcpy(&resent_wheel_event, &event, sizeof(blink::WebMouseWheelEvent));
resent_wheel_event.SetPositionInWidget(
resent_wheel_event.PositionInWidget().x + offset_from_embedder.x(),
resent_wheel_event.PositionInWidget().y + offset_from_embedder.y());
resent_wheel_event.resending_plugin_id = browser_plugin_instance_id_;
// TODO(wjmaclean): Initialize latency info correctly for OOPIFs.
// https://crbug.com/613628
ui::LatencyInfo latency_info(ui::SourceEventType::WHEEL);
view->ProcessMouseWheelEvent(resent_wheel_event, latency_info);
} else {
NOTIMPLEMENTED();
}
}
gfx::Point BrowserPluginGuest::GetCoordinatesInEmbedderWebContents(
const gfx::Point& relative_point) {
RenderWidgetHostView* owner_rwhv = GetOwnerRenderWidgetHostView();
......
......@@ -249,8 +249,6 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost,
void PointerLockPermissionResponse(bool allow);
void ResendEventToEmbedder(const blink::WebInputEvent& event);
gfx::Point GetCoordinatesInEmbedderWebContents(
const gfx::Point& relative_point);
......
......@@ -678,15 +678,6 @@ void ResetTouchAction(RenderWidgetHost* host) {
->ForceResetTouchActionForTest();
}
void ResendGestureScrollUpdateToEmbedder(WebContents* guest_web_contents,
const blink::WebInputEvent& event) {
auto* guest_web_contents_impl =
static_cast<WebContentsImpl*>(guest_web_contents);
DCHECK(guest_web_contents_impl->GetBrowserPluginGuest());
guest_web_contents_impl->GetBrowserPluginGuest()->ResendEventToEmbedder(
event);
}
void RunUntilInputProcessed(RenderWidgetHost* host) {
base::RunLoop run_loop;
RenderWidgetHostImpl::From(host)->WaitForInputProcessed(
......
......@@ -328,11 +328,6 @@ void SimulateKeyPressWithoutChar(WebContents* web_contents,
// Reset touch action for the embedder of a BrowserPluginGuest.
void ResetTouchAction(RenderWidgetHost* host);
// In some cases when an event is send to guest view, it gets resent to the
// embedder.
void ResendGestureScrollUpdateToEmbedder(WebContents* guest_web_contents,
const blink::WebInputEvent& event);
// Spins a run loop until effects of previously forwarded input are fully
// realized.
void RunUntilInputProcessed(RenderWidgetHost* host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment