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 { ...@@ -1088,13 +1088,6 @@ const blink::WebView* RenderViewImpl::webview() const {
// RenderWidgetOwnerDelegate ----------------------------------------- // 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) { void RenderViewImpl::SetActiveForWidget(bool active) {
if (webview()) if (webview())
webview()->SetIsActive(active); webview()->SetIsActive(active);
......
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
#include "ui/surface/transport_dib.h" #include "ui/surface/transport_dib.h"
namespace blink { namespace blink {
class WebMouseEvent;
class WebURLRequest; class WebURLRequest;
struct WebPluginAction; struct WebPluginAction;
struct WebWindowFeatures; struct WebWindowFeatures;
...@@ -405,8 +404,6 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient, ...@@ -405,8 +404,6 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
// RenderWidgetDelegate implementation ---------------------------------- // RenderWidgetDelegate implementation ----------------------------------
bool RenderWidgetWillHandleMouseEventForWidget(
const blink::WebMouseEvent& event) override;
void SetActiveForWidget(bool active) override; void SetActiveForWidget(bool active) override;
bool SupportsMultipleWindowsForWidget() override; bool SupportsMultipleWindowsForWidget() override;
bool ShouldAckSyntheticInputImmediately() override; bool ShouldAckSyntheticInputImmediately() override;
......
...@@ -1685,10 +1685,7 @@ bool RenderWidget::WillHandleMouseEvent(const blink::WebMouseEvent& event) { ...@@ -1685,10 +1685,7 @@ bool RenderWidget::WillHandleMouseEvent(const blink::WebMouseEvent& event) {
possible_drag_event_info_.event_location = possible_drag_event_info_.event_location =
gfx::Point(event.PositionInScreen().x, event.PositionInScreen().y); gfx::Point(event.PositionInScreen().x, event.PositionInScreen().y);
if (delegate()) return mouse_lock_dispatcher()->WillHandleMouseEvent(event);
return delegate()->RenderWidgetWillHandleMouseEventForWidget(event);
return false;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include "content/common/content_export.h" #include "content/common/content_export.h"
namespace blink { namespace blink {
class WebMouseEvent;
class WebWidget; class WebWidget;
struct WebDeviceEmulationParams; struct WebDeviceEmulationParams;
} // namespace blink } // namespace blink
...@@ -25,11 +24,6 @@ class CONTENT_EXPORT RenderWidgetDelegate { ...@@ -25,11 +24,6 @@ class CONTENT_EXPORT RenderWidgetDelegate {
public: public:
virtual ~RenderWidgetDelegate() = default; 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(). // See comment in RenderWidgetHost::SetActive().
virtual void SetActiveForWidget(bool active) = 0; virtual void SetActiveForWidget(bool active) = 0;
......
...@@ -438,10 +438,6 @@ TEST_F(RenderWidgetUnittest, AutoResizeAllocatedLocalSurfaceId) { ...@@ -438,10 +438,6 @@ TEST_F(RenderWidgetUnittest, AutoResizeAllocatedLocalSurfaceId) {
class StubRenderWidgetDelegate : public RenderWidgetDelegate { class StubRenderWidgetDelegate : public RenderWidgetDelegate {
public: public:
bool RenderWidgetWillHandleMouseEventForWidget(
const blink::WebMouseEvent& event) override {
return false;
}
void SetActiveForWidget(bool active) override {} void SetActiveForWidget(bool active) override {}
bool SupportsMultipleWindowsForWidget() override { return true; } bool SupportsMultipleWindowsForWidget() override { return true; }
bool ShouldAckSyntheticInputImmediately() 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