Commit a39aa2de authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

Remove RenderWidgetWillHandleMouseEventForWidget.

RenderWidgets were unnecessarily jumping through RenderViewImpl. This CL
presents a slight behavior change: Previously, this method would only be invoked
on main frame RenderWidgets. Now it's invoked on all RenderWidgets.

Change-Id: I542e1dd5ca0b8376e875594768d23595d78eb8c8
Bug: 912193
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815223
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarLucas Gadani <lfg@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698715}
parent 05adbc6c
......@@ -1088,13 +1088,6 @@ const blink::WebView* RenderViewImpl::webview() const {
// RenderWidgetOwnerDelegate -----------------------------------------
bool RenderViewImpl::RenderWidgetWillHandleMouseEventForWidget(
const blink::WebMouseEvent& event) {
// If the mouse is locked, only the current owner of the mouse lock can
// process mouse events.
return render_widget_->mouse_lock_dispatcher()->WillHandleMouseEvent(event);
}
void RenderViewImpl::SetActiveForWidget(bool active) {
if (webview())
webview()->SetIsActive(active);
......
......@@ -61,7 +61,6 @@
#include "ui/surface/transport_dib.h"
namespace blink {
class WebMouseEvent;
class WebURLRequest;
struct WebPluginAction;
struct WebWindowFeatures;
......@@ -405,8 +404,6 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
// RenderWidgetDelegate implementation ----------------------------------
bool RenderWidgetWillHandleMouseEventForWidget(
const blink::WebMouseEvent& event) override;
void SetActiveForWidget(bool active) override;
bool SupportsMultipleWindowsForWidget() override;
bool ShouldAckSyntheticInputImmediately() override;
......
......@@ -1685,10 +1685,7 @@ bool RenderWidget::WillHandleMouseEvent(const blink::WebMouseEvent& event) {
possible_drag_event_info_.event_location =
gfx::Point(event.PositionInScreen().x, event.PositionInScreen().y);
if (delegate())
return delegate()->RenderWidgetWillHandleMouseEventForWidget(event);
return false;
return mouse_lock_dispatcher()->WillHandleMouseEvent(event);
}
///////////////////////////////////////////////////////////////////////////////
......
......@@ -8,7 +8,6 @@
#include "content/common/content_export.h"
namespace blink {
class WebMouseEvent;
class WebWidget;
struct WebDeviceEmulationParams;
} // namespace blink
......@@ -25,11 +24,6 @@ class CONTENT_EXPORT RenderWidgetDelegate {
public:
virtual ~RenderWidgetDelegate() = default;
// As in RenderWidgetInputHandlerDelegate. Return true if the event was
// handled.
virtual bool RenderWidgetWillHandleMouseEventForWidget(
const blink::WebMouseEvent& event) = 0;
// See comment in RenderWidgetHost::SetActive().
virtual void SetActiveForWidget(bool active) = 0;
......
......@@ -438,10 +438,6 @@ TEST_F(RenderWidgetUnittest, AutoResizeAllocatedLocalSurfaceId) {
class StubRenderWidgetDelegate : public RenderWidgetDelegate {
public:
bool RenderWidgetWillHandleMouseEventForWidget(
const blink::WebMouseEvent& event) override {
return false;
}
void SetActiveForWidget(bool active) override {}
bool SupportsMultipleWindowsForWidget() override { return true; }
bool ShouldAckSyntheticInputImmediately() override { return true; }
......
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