| 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_MANAGER_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ |
| 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "ui/gfx/vector2d_f.h" | 12 #include "ui/gfx/vector2d_f.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 struct LatencyInfo; | 15 struct LatencyInfo; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace cc { | 18 namespace cc { |
| 19 class InputHandler; | 19 class InputHandler; |
| 20 struct DidOverscrollParams; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace blink { | 23 namespace blink { |
| 23 class WebInputEvent; | 24 class WebInputEvent; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace content { | 27 namespace content { |
| 27 struct DidOverscrollParams; | |
| 28 | 28 |
| 29 class CONTENT_EXPORT InputHandlerManagerClient { | 29 class CONTENT_EXPORT InputHandlerManagerClient { |
| 30 public: | 30 public: |
| 31 virtual ~InputHandlerManagerClient() {} | 31 virtual ~InputHandlerManagerClient() {} |
| 32 | 32 |
| 33 // The Manager will supply a |handler| when bound to the client. This is valid | 33 // The Manager will supply a |handler| when bound to the client. This is valid |
| 34 // until the manager shuts down, at which point it supplies a null |handler|. | 34 // until the manager shuts down, at which point it supplies a null |handler|. |
| 35 // The client should only makes calls to |handler| on the compositor thread. | 35 // The client should only makes calls to |handler| on the compositor thread. |
| 36 typedef base::Callback< | 36 typedef base::Callback< |
| 37 InputEventAckState(int /*routing_id*/, | 37 InputEventAckState(int /*routing_id*/, |
| 38 const blink::WebInputEvent*, | 38 const blink::WebInputEvent*, |
| 39 ui::LatencyInfo* latency_info)> Handler; | 39 ui::LatencyInfo* latency_info)> Handler; |
| 40 | 40 |
| 41 // Called from the main thread. | 41 // Called from the main thread. |
| 42 virtual void SetBoundHandler(const Handler& handler) = 0; | 42 virtual void SetBoundHandler(const Handler& handler) = 0; |
| 43 | 43 |
| 44 // Called from the compositor thread. | 44 // Called from the compositor thread. |
| 45 virtual void DidAddInputHandler(int routing_id, | 45 virtual void DidAddInputHandler(int routing_id, |
| 46 cc::InputHandler* input_handler) = 0; | 46 cc::InputHandler* input_handler) = 0; |
| 47 virtual void DidRemoveInputHandler(int routing_id) = 0; | 47 virtual void DidRemoveInputHandler(int routing_id) = 0; |
| 48 virtual void DidOverscroll(int routing_id, | 48 virtual void DidOverscroll(int routing_id, |
| 49 const DidOverscrollParams& params) = 0; | 49 const cc::DidOverscrollParams& params) = 0; |
| 50 virtual void DidStopFlinging(int routing_id) = 0; | 50 virtual void DidStopFlinging(int routing_id) = 0; |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 InputHandlerManagerClient() {} | 53 InputHandlerManagerClient() {} |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); | 56 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace content | 59 } // namespace content |
| 60 | 60 |
| 61 #endif // CONTENT_COMMON_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ | 61 #endif // CONTENT_COMMON_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |
| OLD | NEW |