Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: content/renderer/input/render_widget_input_handler.cc

Issue 1631963002: Plumb firing passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners_2a
Patch Set: Set dependency correctly Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/input/render_widget_input_handler.cc
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc
index d5d5255c02f9c864a383a94ca1745f640d47461b..238ad5fe4e1efba35b24f8541a91607ed8814bbe 100644
--- a/content/renderer/input/render_widget_input_handler.cc
+++ b/content/renderer/input/render_widget_input_handler.cc
@@ -191,9 +191,8 @@ RenderWidgetInputHandler::~RenderWidgetInputHandler() {}
void RenderWidgetInputHandler::HandleInputEvent(
const WebInputEvent& input_event,
- const ui::LatencyInfo& latency_info) {
- // TODO(dtapuska): Passive support not implemented yet crbug.com/489802
- bool passive = false;
+ const ui::LatencyInfo& latency_info,
+ bool passive) {
base::AutoReset<bool> handling_input_event_resetter(&handling_input_event_,
true);
base::AutoReset<WebInputEvent::Type> handling_event_type_resetter(
@@ -356,11 +355,15 @@ void RenderWidgetInputHandler::HandleInputEvent(
// Send mouse wheel events and their disposition to the compositor thread, so
// that they can be used to produce the elastic overscroll effect on Mac.
if (input_event.type == WebInputEvent::MouseWheel) {
- delegate_->ObserveWheelEventAndResult(
- static_cast<const WebMouseWheelEvent&>(input_event),
- event_overscroll ? event_overscroll->latest_overscroll_delta
- : gfx::Vector2dF(),
- processed != WebInputEventResult::NotHandled);
+ const WebMouseWheelEvent& wheel_event =
+ static_cast<const WebMouseWheelEvent&>(input_event);
+ if (wheel_event.canScroll) {
tdresser 2016/01/26 16:34:37 The canScroll check is unrelated to the rest of yo
dtapuska 2016/01/26 16:53:15 Ultimately yes; for passive wheel listeners; canSc
tdresser 2016/01/26 18:45:42 Acknowledged.
+ delegate_->ObserveWheelEventAndResult(
+ wheel_event,
+ event_overscroll ? event_overscroll->latest_overscroll_delta
+ : gfx::Vector2dF(),
+ processed != WebInputEventResult::NotHandled);
+ }
}
bool frame_pending =
@@ -384,7 +387,12 @@ void RenderWidgetInputHandler::HandleInputEvent(
// by reentrant calls for events after the paused one.
bool no_ack = ignore_ack_for_mouse_move_from_debugger_ &&
input_event.type == WebInputEvent::MouseMove;
- if (WebInputEventTraits::WillReceiveAckFromRenderer(input_event) && !no_ack) {
+ if (passive) {
+ // Passive means it was ack'd already by the InputHandlerProxy
+ // so let the delegate know the passive event has been handled.
+ delegate_->PassiveInputEventHandled(input_event.type);
+ } else if (WebInputEventTraits::WillReceiveAckFromRenderer(input_event) &&
+ !no_ack) {
tdresser 2016/01/26 16:34:37 Is this indentation correct?
dtapuska 2016/01/26 16:53:15 Done.
scoped_ptr<InputEventAck> response(new InputEventAck(
input_event.type, ack_result, swap_latency_info,
std::move(event_overscroll),

Powered by Google App Engine
This is Rietveld 408576698