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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOUSE_WHEEL_PHASE_HANDLER_H_
6 #define MOUSE_WHEEL_PHASE_HANDLER_H_
7
8 #include "base/timer/timer.h"
9 #include "content/browser/renderer_host/render_widget_host_delegate.h"
10
11 namespace content {
12 class RenderWidgetHostImpl;
13 class RenderWidgetHostViewBase;
14
15 // The duration after which a synthetic wheel with zero deltas and
16 // phase = |kPhaseEnded| will be sent after the last wheel event.
17 const int64_t kDefaultMouseWheelLatchingTransactionMs = 100;
18
19 class MouseWheelPhaseHandler {
20 public:
21 MouseWheelPhaseHandler(RenderWidgetHostImpl* const host,
22 RenderWidgetHostViewBase* const host_view);
23 ~MouseWheelPhaseHandler() {}
24
25 void AddPhaseIfNeededAndScheduleEndEvent(
26 blink::WebMouseWheelEvent& mouse_wheel_event,
27 bool should_route_event);
28 void DispatchPendingWheelEndEvent();
29 void IgnorePendingWheelEndEvent();
30 bool HasPendingWheelEndEvent() const {
31 return mouse_wheel_end_dispatch_timer_.IsRunning();
32 }
33
34 private:
35 void SendSyntheticWheelEventWithPhaseEnded(
36 blink::WebMouseWheelEvent last_mouse_wheel_event,
37 bool should_route_event);
38 void ScheduleMouseWheelEndDispatching(blink::WebMouseWheelEvent wheel_event,
39 bool should_route_event);
40
41 RenderWidgetHostImpl* const host_;
42 RenderWidgetHostViewBase* const host_view_;
43 base::OneShotTimer mouse_wheel_end_dispatch_timer_;
44
45 DISALLOW_COPY_AND_ASSIGN(MouseWheelPhaseHandler);
46 };
47
48 } // namespace content
49
50 #endif // MOUSE_WHEEL_PHASE_HANDLER_H_
OLDNEW
« 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