| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_INPUT_HANDLER_WRAPPER_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ |
| 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "content/renderer/input/input_handler_manager.h" | 11 #include "content/renderer/input/input_handler_manager.h" |
| 12 #include "ui/events/blink/input_handler_proxy.h" | 12 #include "ui/events/blink/input_handler_proxy.h" |
| 13 #include "ui/events/blink/input_handler_proxy_client.h" | 13 #include "ui/events/blink/input_handler_proxy_client.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 class InputHandlerProxy; | 16 class InputHandlerProxy; |
| 17 class InputHandlerProxyClient; | 17 class InputHandlerProxyClient; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 | 21 |
| 22 // This class lives on the compositor thread. | 22 // This class lives on the compositor thread. |
| 23 class InputHandlerWrapper : public ui::InputHandlerProxyClient { | 23 class InputHandlerWrapper : public ui::InputHandlerProxyClient { |
| 24 public: | 24 public: |
| 25 InputHandlerWrapper( | 25 InputHandlerWrapper( |
| 26 InputHandlerManager* input_handler_manager, | 26 InputHandlerManager* input_handler_manager, |
| 27 int routing_id, | 27 int routing_id, |
| 28 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, | 28 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, |
| 29 const base::WeakPtr<cc::InputHandler>& input_handler, | 29 const base::WeakPtr<cc::InputHandler>& input_handler, |
| 30 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 30 const base::WeakPtr<RenderWidget>& render_widget, |
| 31 bool enable_smooth_scrolling); | 31 bool enable_smooth_scrolling); |
| 32 ~InputHandlerWrapper() override; | 32 ~InputHandlerWrapper() override; |
| 33 | 33 |
| 34 int routing_id() const { return routing_id_; } | 34 int routing_id() const { return routing_id_; } |
| 35 ui::InputHandlerProxy* input_handler_proxy() { | 35 ui::InputHandlerProxy* input_handler_proxy() { |
| 36 return &input_handler_proxy_; | 36 return &input_handler_proxy_; |
| 37 } | 37 } |
| 38 | 38 |
| 39 void NeedsMainFrame(); | 39 void NeedsMainFrame(); |
| 40 | 40 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 57 void DidStopFlinging() override; | 57 void DidStopFlinging() override; |
| 58 void DidAnimateForInput() override; | 58 void DidAnimateForInput() override; |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 InputHandlerManager* input_handler_manager_; | 61 InputHandlerManager* input_handler_manager_; |
| 62 int routing_id_; | 62 int routing_id_; |
| 63 ui::InputHandlerProxy input_handler_proxy_; | 63 ui::InputHandlerProxy input_handler_proxy_; |
| 64 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 64 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 65 | 65 |
| 66 // Can only be accessed on the main thread. | 66 // Can only be accessed on the main thread. |
| 67 base::WeakPtr<RenderViewImpl> render_view_impl_; | 67 base::WeakPtr<RenderWidget> render_widget_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(InputHandlerWrapper); | 69 DISALLOW_COPY_AND_ASSIGN(InputHandlerWrapper); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace content | 72 } // namespace content |
| 73 | 73 |
| 74 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ | 74 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ |
| OLD | NEW |