OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_H_ |
6 #define CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_H_ | 6 #define CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_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" | 11 #include "base/time/time.h" |
12 #include "content/common/input/input_event_ack.h" | 12 #include "content/common/input/input_event_ack.h" |
13 #include "content/common/input/input_event_dispatch_type.h" | 13 #include "content/common/input/input_event_dispatch_type.h" |
14 #include "content/renderer/input/main_thread_event_queue.h" | 14 #include "content/renderer/input/main_thread_event_queue.h" |
15 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h" | 15 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h" |
16 #include "ui/base/ui_base_types.h" | 16 #include "ui/base/ui_base_types.h" |
17 #include "ui/events/blink/did_overscroll_params.h" | 17 #include "ui/events/blink/did_overscroll_params.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 struct WebFloatPoint; | 20 struct WebFloatPoint; |
21 struct WebFloatSize; | 21 struct WebFloatSize; |
| 22 struct WebScrollBoundaryBehavior; |
22 } | 23 } |
23 | 24 |
24 namespace ui { | 25 namespace ui { |
25 class LatencyInfo; | 26 class LatencyInfo; |
26 } | 27 } |
27 | 28 |
28 namespace content { | 29 namespace content { |
29 | 30 |
30 class RenderWidget; | 31 class RenderWidget; |
31 class RenderWidgetInputHandlerDelegate; | 32 class RenderWidgetInputHandlerDelegate; |
32 | 33 |
33 // RenderWidgetInputHandler is an IPC-agnostic input handling class. | 34 // RenderWidgetInputHandler is an IPC-agnostic input handling class. |
34 // IPC transport code should live in RenderWidget or RenderWidgetMusConnection. | 35 // IPC transport code should live in RenderWidget or RenderWidgetMusConnection. |
35 class CONTENT_EXPORT RenderWidgetInputHandler { | 36 class CONTENT_EXPORT RenderWidgetInputHandler { |
36 public: | 37 public: |
37 RenderWidgetInputHandler(RenderWidgetInputHandlerDelegate* delegate, | 38 RenderWidgetInputHandler(RenderWidgetInputHandlerDelegate* delegate, |
38 RenderWidget* widget); | 39 RenderWidget* widget); |
39 virtual ~RenderWidgetInputHandler(); | 40 virtual ~RenderWidgetInputHandler(); |
40 | 41 |
41 // Handle input events from the input event provider. | 42 // Handle input events from the input event provider. |
42 virtual void HandleInputEvent( | 43 virtual void HandleInputEvent( |
43 const blink::WebCoalescedInputEvent& coalesced_event, | 44 const blink::WebCoalescedInputEvent& coalesced_event, |
44 const ui::LatencyInfo& latency_info, | 45 const ui::LatencyInfo& latency_info, |
45 HandledEventCallback callback); | 46 HandledEventCallback callback); |
46 | 47 |
47 // Handle overscroll from Blink. | 48 // Handle overscroll from Blink. |
48 void DidOverscrollFromBlink( | 49 void DidOverscrollFromBlink(const blink::WebFloatSize& overscrollDelta, |
49 const blink::WebFloatSize& overscrollDelta, | 50 const blink::WebFloatSize& accumulatedOverscroll, |
50 const blink::WebFloatSize& accumulatedOverscroll, | 51 const blink::WebFloatPoint& position, |
51 const blink::WebFloatPoint& position, | 52 const blink::WebFloatSize& velocity, |
52 const blink::WebFloatSize& velocity); | 53 const blink::WebScrollBoundaryBehavior& behavior); |
53 | 54 |
54 bool handling_input_event() const { return handling_input_event_; } | 55 bool handling_input_event() const { return handling_input_event_; } |
55 void set_handling_input_event(bool handling_input_event) { | 56 void set_handling_input_event(bool handling_input_event) { |
56 handling_input_event_ = handling_input_event; | 57 handling_input_event_ = handling_input_event; |
57 } | 58 } |
58 | 59 |
59 blink::WebInputEvent::Type handling_event_type() const { | 60 blink::WebInputEvent::Type handling_event_type() const { |
60 return handling_event_type_; | 61 return handling_event_type_; |
61 } | 62 } |
62 | 63 |
(...skipping 16 matching lines...) Expand all Loading... |
79 | 80 |
80 // Indicates if the next sequence of Char events should be suppressed or not. | 81 // Indicates if the next sequence of Char events should be suppressed or not. |
81 bool suppress_next_char_events_; | 82 bool suppress_next_char_events_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(RenderWidgetInputHandler); | 84 DISALLOW_COPY_AND_ASSIGN(RenderWidgetInputHandler); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace content | 87 } // namespace content |
87 | 88 |
88 #endif // CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_H_ | 89 #endif // CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_H_ |
OLD | NEW |