Chromium Code Reviews| Index: content/browser/devtools/protocol/input_handler.h |
| diff --git a/content/browser/devtools/protocol/input_handler.h b/content/browser/devtools/protocol/input_handler.h |
| index 6e548a5cbcbd24e17c4b199fe3f843967fdc49d0..5547960630cab710f95e980422d9419d1f51f613 100644 |
| --- a/content/browser/devtools/protocol/input_handler.h |
| +++ b/content/browser/devtools/protocol/input_handler.h |
| @@ -10,6 +10,7 @@ |
| #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
| #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" |
| +#include "content/public/browser/render_widget_host.h" |
| #include "ui/gfx/geometry/size_f.h" |
| namespace cc { |
| @@ -27,18 +28,24 @@ class RenderWidgetHostImpl; |
| namespace devtools { |
| namespace input { |
| -class InputHandler { |
| +class InputHandler : public RenderWidgetHost::InputEventObserver { |
| public: |
| typedef DevToolsProtocolClient::Response Response; |
| InputHandler(); |
| - virtual ~InputHandler(); |
| + ~InputHandler() override; |
| + |
| + // InputEventObserver |
| + void OnInputEvent(const blink::WebInputEvent& event) override {}; |
| + void OnInputEventAck(const blink::WebInputEvent& event, bool was_synthetic) |
| + override; |
| void SetRenderWidgetHost(RenderWidgetHostImpl* host); |
| void SetClient(std::unique_ptr<Client> client); |
| void OnSwapCompositorFrame(const cc::CompositorFrameMetadata& frame_metadata); |
| - Response DispatchKeyEvent(const std::string& type, |
| + Response DispatchKeyEvent(DevToolsCommandId command_id, |
| + const std::string& type, |
| const int* modifiers, |
| const double* timestamp, |
| const std::string* text, |
| @@ -99,6 +106,8 @@ class InputHandler { |
| const std::string* gesture_source_type); |
| private: |
| + void SendDispatchKeyEventResponse(DevToolsCommandId command_id); |
| + |
| void SendSynthesizePinchGestureResponse(DevToolsCommandId command_id, |
| SyntheticGesture::Result result); |
| @@ -125,6 +134,7 @@ class InputHandler { |
| RenderWidgetHostImpl* host_; |
| std::unique_ptr<Client> client_; |
| + std::queue<DevToolsCommandId> pending_key_event_ids_; |
|
tdresser
2016/10/12 19:49:36
Can you add a comment here explaining what we're d
samuong
2016/10/13 22:59:10
Done.
|
| float page_scale_factor_; |
| gfx::SizeF scrollable_viewport_size_; |
| base::WeakPtrFactory<InputHandler> weak_factory_; |