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

Unified Diff: content/browser/renderer_host/input/mouse_wheel_phase_handler.h

Issue 2914393002: Adding phase info to wheel events migrated to wheel phase handler class. (Closed)
Patch Set: fixed mouse_wheel_phase_handler_path in rwhv_mac Created 3 years, 6 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
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/renderer_host/input/mouse_wheel_phase_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/mouse_wheel_phase_handler.h
diff --git a/content/browser/renderer_host/input/mouse_wheel_phase_handler.h b/content/browser/renderer_host/input/mouse_wheel_phase_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa4a20e4942b239d56b661a7c71e8d27ebcbcf80
--- /dev/null
+++ b/content/browser/renderer_host/input/mouse_wheel_phase_handler.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOUSE_WHEEL_PHASE_HANDLER_H_
+#define MOUSE_WHEEL_PHASE_HANDLER_H_
+
+#include "base/timer/timer.h"
+#include "content/browser/renderer_host/render_widget_host_delegate.h"
+
+namespace content {
+class RenderWidgetHostImpl;
+class RenderWidgetHostViewBase;
+
+// The duration after which a synthetic wheel with zero deltas and
+// phase = |kPhaseEnded| will be sent after the last wheel event.
+const int64_t kDefaultMouseWheelLatchingTransactionMs = 100;
+
+class MouseWheelPhaseHandler {
+ public:
+ MouseWheelPhaseHandler(RenderWidgetHostImpl* const host,
+ RenderWidgetHostViewBase* const host_view);
+ ~MouseWheelPhaseHandler() {}
+
+ void AddPhaseIfNeededAndScheduleEndEvent(
+ blink::WebMouseWheelEvent& mouse_wheel_event,
+ bool should_route_event);
+ void DispatchPendingWheelEndEvent();
+ void IgnorePendingWheelEndEvent();
+ bool HasPendingWheelEndEvent() const {
+ return mouse_wheel_end_dispatch_timer_.IsRunning();
+ }
+
+ private:
+ void SendSyntheticWheelEventWithPhaseEnded(
+ blink::WebMouseWheelEvent last_mouse_wheel_event,
+ bool should_route_event);
+ void ScheduleMouseWheelEndDispatching(blink::WebMouseWheelEvent wheel_event,
+ bool should_route_event);
+
+ RenderWidgetHostImpl* const host_;
+ RenderWidgetHostViewBase* const host_view_;
+ base::OneShotTimer mouse_wheel_end_dispatch_timer_;
+
+ DISALLOW_COPY_AND_ASSIGN(MouseWheelPhaseHandler);
+};
+
+} // namespace content
+
+#endif // MOUSE_WHEEL_PHASE_HANDLER_H_
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/renderer_host/input/mouse_wheel_phase_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698