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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_event_handler.h

Issue 2882443002: Tiimer based phase info generated for mouse wheel events. (Closed)
Patch Set: debouncing queue disabled to count sent messages properly Created 3 years, 7 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/time/time.h"
12 #include "base/timer/timer.h"
tdresser 2017/05/18 13:49:06 Are both of these being used?
sahel 2017/05/18 18:15:15 Done.
11 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
12 #include "content/public/browser/native_web_keyboard_event.h" 14 #include "content/public/browser/native_web_keyboard_event.h"
13 #include "ui/aura/window_tracker.h" 15 #include "ui/aura/window_tracker.h"
14 #include "ui/events/event_handler.h" 16 #include "ui/events/event_handler.h"
15 #include "ui/events/gestures/motion_event_aura.h" 17 #include "ui/events/gestures/motion_event_aura.h"
16 #include "ui/latency/latency_info.h" 18 #include "ui/latency/latency_info.h"
17 19
18 namespace aura { 20 namespace aura {
19 class Window; 21 class Window;
20 } // namespace aura 22 } // namespace aura
21 23
22 namespace blink { 24 namespace blink {
23 class WebMouseEvent; 25 class WebMouseEvent;
24 class WebMouseWheelEvent; 26 class WebMouseWheelEvent;
25 class WebTouchEvent; 27 class WebTouchEvent;
26 } // namespace blink 28 } // namespace blink
27 29
28 namespace ui { 30 namespace ui {
29 class TextInputClient; 31 class TextInputClient;
30 class TouchSelectionController; 32 class TouchSelectionController;
31 } 33 }
32 34
33 namespace content { 35 namespace content {
36
37 // The duration in which a synthetic wheel with zero deltas and
tdresser 2017/05/18 13:49:06 in which -> after which
sahel 2017/05/18 18:15:15 Done.
38 // phase = |kPhaseEnded| will be sent after the last wheel event.
39 const int64_t kDefaultMouseWheelLatchingTransactionMs = 100;
40
34 struct ContextMenuParams; 41 struct ContextMenuParams;
35 class OverscrollController; 42 class OverscrollController;
36 class RenderWidgetHostImpl; 43 class RenderWidgetHostImpl;
37 class RenderWidgetHostViewBase; 44 class RenderWidgetHostViewBase;
38 class TouchSelectionControllerClientAura; 45 class TouchSelectionControllerClientAura;
39 46
40 // Provides an implementation of ui::EventHandler for use with 47 // Provides an implementation of ui::EventHandler for use with
41 // RenderWidgetHostViewBase. A delegate is required in order to provide platform 48 // RenderWidgetHostViewBase. A delegate is required in order to provide platform
42 // specific functionality. 49 // specific functionality.
43 // 50 //
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Returns true when we can do SurfaceHitTesting for the event type. 185 // Returns true when we can do SurfaceHitTesting for the event type.
179 bool ShouldRouteEvent(const ui::Event* event) const; 186 bool ShouldRouteEvent(const ui::Event* event) const;
180 187
181 // Directs events to the |host_|. 188 // Directs events to the |host_|.
182 void ProcessMouseEvent(const blink::WebMouseEvent& event, 189 void ProcessMouseEvent(const blink::WebMouseEvent& event,
183 const ui::LatencyInfo& latency); 190 const ui::LatencyInfo& latency);
184 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event, 191 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event,
185 const ui::LatencyInfo& latency); 192 const ui::LatencyInfo& latency);
186 void ProcessTouchEvent(const blink::WebTouchEvent& event, 193 void ProcessTouchEvent(const blink::WebTouchEvent& event,
187 const ui::LatencyInfo& latency); 194 const ui::LatencyInfo& latency);
195 void SendSyntheticWheelEventWithPhaseEnded(
196 blink::WebMouseWheelEvent last_mouse_wheel_event,
197 bool should_route_event);
198 void AddSyntheticPhase(blink::WebMouseWheelEvent& mouse_wheel_event,
199 bool should_route_event);
188 200
189 // Whether return characters should be passed on to the RenderWidgetHostImpl. 201 // Whether return characters should be passed on to the RenderWidgetHostImpl.
190 bool accept_return_character_; 202 bool accept_return_character_;
191 203
192 // Allows tests to send gesture events for testing without first sending a 204 // Allows tests to send gesture events for testing without first sending a
193 // corresponding touch sequence, as would be required by 205 // corresponding touch sequence, as would be required by
194 // RenderWidgetHostInputEventRouter. 206 // RenderWidgetHostInputEventRouter.
195 bool disable_input_event_router_for_testing_; 207 bool disable_input_event_router_for_testing_;
196 208
197 // While the mouse is locked, the cursor is hidden from the user. Mouse events 209 // While the mouse is locked, the cursor is hidden from the user. Mouse events
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // The following are not owned. They should outlive |this| 252 // The following are not owned. They should outlive |this|
241 RenderWidgetHostImpl* const host_; 253 RenderWidgetHostImpl* const host_;
242 // Should create |this| and own it. 254 // Should create |this| and own it.
243 RenderWidgetHostViewBase* const host_view_; 255 RenderWidgetHostViewBase* const host_view_;
244 // Optional, used to redirect events to a popup and associated handler. 256 // Optional, used to redirect events to a popup and associated handler.
245 RenderWidgetHostViewBase* popup_child_host_view_; 257 RenderWidgetHostViewBase* popup_child_host_view_;
246 ui::EventHandler* popup_child_event_handler_; 258 ui::EventHandler* popup_child_event_handler_;
247 Delegate* const delegate_; 259 Delegate* const delegate_;
248 aura::Window* window_; 260 aura::Window* window_;
249 261
262 base::OneShotTimer mouse_wheel_phase_timer_;
tdresser 2017/05/18 13:49:06 Maybe |dispatch_synthetic_mouse_wheel_end_timer_|?
bokan 2017/05/18 16:47:01 I like mouse_wheel_end_dispatch_timer_.
sahel 2017/05/18 18:15:15 Done.
263
250 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewEventHandler); 264 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewEventHandler);
251 }; 265 };
252 266
253 } // namespace content 267 } // namespace content
254 268
255 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H _ 269 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698