| OLD | NEW |
| 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/timer/timer.h" |
| 11 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 12 #include "content/public/browser/native_web_keyboard_event.h" | 13 #include "content/public/browser/native_web_keyboard_event.h" |
| 13 #include "ui/aura/window_tracker.h" | 14 #include "ui/aura/window_tracker.h" |
| 14 #include "ui/events/event_handler.h" | 15 #include "ui/events/event_handler.h" |
| 15 #include "ui/events/gestures/motion_event_aura.h" | 16 #include "ui/events/gestures/motion_event_aura.h" |
| 16 #include "ui/latency/latency_info.h" | 17 #include "ui/latency/latency_info.h" |
| 17 | 18 |
| 18 namespace aura { | 19 namespace aura { |
| 19 class Window; | 20 class Window; |
| 20 } // namespace aura | 21 } // namespace aura |
| 21 | 22 |
| 22 namespace blink { | 23 namespace blink { |
| 23 class WebMouseEvent; | 24 class WebMouseEvent; |
| 24 class WebMouseWheelEvent; | 25 class WebMouseWheelEvent; |
| 25 class WebTouchEvent; | 26 class WebTouchEvent; |
| 26 } // namespace blink | 27 } // namespace blink |
| 27 | 28 |
| 28 namespace ui { | 29 namespace ui { |
| 29 class TextInputClient; | 30 class TextInputClient; |
| 30 class TouchSelectionController; | 31 class TouchSelectionController; |
| 31 } | 32 } |
| 32 | 33 |
| 33 namespace content { | 34 namespace content { |
| 35 |
| 36 // The duration after which a synthetic wheel with zero deltas and |
| 37 // phase = |kPhaseEnded| will be sent after the last wheel event. |
| 38 const int64_t kDefaultMouseWheelLatchingTransactionMs = 100; |
| 39 |
| 34 struct ContextMenuParams; | 40 struct ContextMenuParams; |
| 35 class OverscrollController; | 41 class OverscrollController; |
| 36 class RenderWidgetHostImpl; | 42 class RenderWidgetHostImpl; |
| 37 class RenderWidgetHostViewBase; | 43 class RenderWidgetHostViewBase; |
| 38 class TouchSelectionControllerClientAura; | 44 class TouchSelectionControllerClientAura; |
| 39 | 45 |
| 40 // Provides an implementation of ui::EventHandler for use with | 46 // Provides an implementation of ui::EventHandler for use with |
| 41 // RenderWidgetHostViewBase. A delegate is required in order to provide platform | 47 // RenderWidgetHostViewBase. A delegate is required in order to provide platform |
| 42 // specific functionality. | 48 // specific functionality. |
| 43 // | 49 // |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // Returns true when we can do SurfaceHitTesting for the event type. | 184 // Returns true when we can do SurfaceHitTesting for the event type. |
| 179 bool ShouldRouteEvent(const ui::Event* event) const; | 185 bool ShouldRouteEvent(const ui::Event* event) const; |
| 180 | 186 |
| 181 // Directs events to the |host_|. | 187 // Directs events to the |host_|. |
| 182 void ProcessMouseEvent(const blink::WebMouseEvent& event, | 188 void ProcessMouseEvent(const blink::WebMouseEvent& event, |
| 183 const ui::LatencyInfo& latency); | 189 const ui::LatencyInfo& latency); |
| 184 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event, | 190 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event, |
| 185 const ui::LatencyInfo& latency); | 191 const ui::LatencyInfo& latency); |
| 186 void ProcessTouchEvent(const blink::WebTouchEvent& event, | 192 void ProcessTouchEvent(const blink::WebTouchEvent& event, |
| 187 const ui::LatencyInfo& latency); | 193 const ui::LatencyInfo& latency); |
| 194 void SendSyntheticWheelEventWithPhaseEnded( |
| 195 blink::WebMouseWheelEvent last_mouse_wheel_event, |
| 196 bool should_route_event); |
| 197 void AddPhaseAndScheduleEndEvent(blink::WebMouseWheelEvent& mouse_wheel_event, |
| 198 bool should_route_event); |
| 188 | 199 |
| 189 // Whether return characters should be passed on to the RenderWidgetHostImpl. | 200 // Whether return characters should be passed on to the RenderWidgetHostImpl. |
| 190 bool accept_return_character_; | 201 bool accept_return_character_; |
| 191 | 202 |
| 192 // Allows tests to send gesture events for testing without first sending a | 203 // Allows tests to send gesture events for testing without first sending a |
| 193 // corresponding touch sequence, as would be required by | 204 // corresponding touch sequence, as would be required by |
| 194 // RenderWidgetHostInputEventRouter. | 205 // RenderWidgetHostInputEventRouter. |
| 195 bool disable_input_event_router_for_testing_; | 206 bool disable_input_event_router_for_testing_; |
| 196 | 207 |
| 197 // While the mouse is locked, the cursor is hidden from the user. Mouse events | 208 // 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 Loading... |
| 240 // The following are not owned. They should outlive |this| | 251 // The following are not owned. They should outlive |this| |
| 241 RenderWidgetHostImpl* const host_; | 252 RenderWidgetHostImpl* const host_; |
| 242 // Should create |this| and own it. | 253 // Should create |this| and own it. |
| 243 RenderWidgetHostViewBase* const host_view_; | 254 RenderWidgetHostViewBase* const host_view_; |
| 244 // Optional, used to redirect events to a popup and associated handler. | 255 // Optional, used to redirect events to a popup and associated handler. |
| 245 RenderWidgetHostViewBase* popup_child_host_view_; | 256 RenderWidgetHostViewBase* popup_child_host_view_; |
| 246 ui::EventHandler* popup_child_event_handler_; | 257 ui::EventHandler* popup_child_event_handler_; |
| 247 Delegate* const delegate_; | 258 Delegate* const delegate_; |
| 248 aura::Window* window_; | 259 aura::Window* window_; |
| 249 | 260 |
| 261 base::OneShotTimer mouse_wheel_end_dispatch_timer_; |
| 262 |
| 250 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewEventHandler); | 263 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewEventHandler); |
| 251 }; | 264 }; |
| 252 | 265 |
| 253 } // namespace content | 266 } // namespace content |
| 254 | 267 |
| 255 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H
_ | 268 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_EVENT_HANDLER_H
_ |
| OLD | NEW |