| 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 "third_party/WebKit/public/platform/WebCoalescedInputEvent.h" | 14 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h" |
| 15 #include "ui/base/ui_base_types.h" | 15 #include "ui/base/ui_base_types.h" |
| 16 #include "ui/events/blink/did_overscroll_params.h" | 16 #include "ui/events/blink/did_overscroll_params.h" |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 struct WebFloatPoint; | 19 struct WebFloatPoint; |
| 20 struct WebFloatSize; | 20 struct WebFloatSize; |
| 21 struct WebScrollBoundaryBehavior; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace ui { | 24 namespace ui { |
| 24 class LatencyInfo; | 25 class LatencyInfo; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace content { | 28 namespace content { |
| 28 | 29 |
| 29 class RenderWidget; | 30 class RenderWidget; |
| 30 class RenderWidgetInputHandlerDelegate; | 31 class RenderWidgetInputHandlerDelegate; |
| 31 | 32 |
| 32 // RenderWidgetInputHandler is an IPC-agnostic input handling class. | 33 // RenderWidgetInputHandler is an IPC-agnostic input handling class. |
| 33 // IPC transport code should live in RenderWidget or RenderWidgetMusConnection. | 34 // IPC transport code should live in RenderWidget or RenderWidgetMusConnection. |
| 34 class CONTENT_EXPORT RenderWidgetInputHandler { | 35 class CONTENT_EXPORT RenderWidgetInputHandler { |
| 35 public: | 36 public: |
| 36 RenderWidgetInputHandler(RenderWidgetInputHandlerDelegate* delegate, | 37 RenderWidgetInputHandler(RenderWidgetInputHandlerDelegate* delegate, |
| 37 RenderWidget* widget); | 38 RenderWidget* widget); |
| 38 virtual ~RenderWidgetInputHandler(); | 39 virtual ~RenderWidgetInputHandler(); |
| 39 | 40 |
| 40 // Handle input events from the input event provider. | 41 // Handle input events from the input event provider. |
| 41 virtual InputEventAckState HandleInputEvent( | 42 virtual InputEventAckState HandleInputEvent( |
| 42 const blink::WebCoalescedInputEvent& coalesced_event, | 43 const blink::WebCoalescedInputEvent& coalesced_event, |
| 43 const ui::LatencyInfo& latency_info, | 44 const ui::LatencyInfo& latency_info, |
| 44 InputEventDispatchType dispatch_type); | 45 InputEventDispatchType dispatch_type); |
| 45 | 46 |
| 46 // Handle overscroll from Blink. | 47 // Handle overscroll from Blink. |
| 47 void DidOverscrollFromBlink( | 48 void DidOverscrollFromBlink(const blink::WebFloatSize& overscrollDelta, |
| 48 const blink::WebFloatSize& overscrollDelta, | 49 const blink::WebFloatSize& accumulatedOverscroll, |
| 49 const blink::WebFloatSize& accumulatedOverscroll, | 50 const blink::WebFloatPoint& position, |
| 50 const blink::WebFloatPoint& position, | 51 const blink::WebFloatSize& velocity, |
| 51 const blink::WebFloatSize& velocity); | 52 const blink::WebScrollBoundaryBehavior& behavior); |
| 52 | 53 |
| 53 bool handling_input_event() const { return handling_input_event_; } | 54 bool handling_input_event() const { return handling_input_event_; } |
| 54 void set_handling_input_event(bool handling_input_event) { | 55 void set_handling_input_event(bool handling_input_event) { |
| 55 handling_input_event_ = handling_input_event; | 56 handling_input_event_ = handling_input_event; |
| 56 } | 57 } |
| 57 | 58 |
| 58 blink::WebInputEvent::Type handling_event_type() const { | 59 blink::WebInputEvent::Type handling_event_type() const { |
| 59 return handling_event_type_; | 60 return handling_event_type_; |
| 60 } | 61 } |
| 61 | 62 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 87 | 88 |
| 88 // Indicates if the next sequence of Char events should be suppressed or not. | 89 // Indicates if the next sequence of Char events should be suppressed or not. |
| 89 bool suppress_next_char_events_; | 90 bool suppress_next_char_events_; |
| 90 | 91 |
| 91 DISALLOW_COPY_AND_ASSIGN(RenderWidgetInputHandler); | 92 DISALLOW_COPY_AND_ASSIGN(RenderWidgetInputHandler); |
| 92 }; | 93 }; |
| 93 | 94 |
| 94 } // namespace content | 95 } // namespace content |
| 95 | 96 |
| 96 #endif // CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_H_ | 97 #endif // CONTENT_RENDERER_INPUT_RENDER_WIDGET_INPUT_HANDLER_H_ |
| OLD | NEW |