| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CCInputHandler_h | 5 #ifndef CCInputHandler_h |
| 6 #define CCInputHandler_h | 6 #define CCInputHandler_h |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/time.h" |
| 9 | 10 |
| 10 namespace cc { | 11 namespace cc { |
| 11 | 12 |
| 12 class IntPoint; | 13 class IntPoint; |
| 13 class IntSize; | 14 class IntSize; |
| 14 | 15 |
| 15 // The InputHandler is a way for the embedders to interact with | 16 // The InputHandler is a way for the embedders to interact with |
| 16 // the impl thread side of the compositor implementation. | 17 // the impl thread side of the compositor implementation. |
| 17 // | 18 // |
| 18 // There is one InputHandler for every LayerTreeHost. It is | 19 // There is one InputHandler for every LayerTreeHost. It is |
| (...skipping 26 matching lines...) Expand all Loading... |
| 45 // returned ScrollStarted. | 46 // returned ScrollStarted. |
| 46 virtual void scrollEnd() = 0; | 47 virtual void scrollEnd() = 0; |
| 47 | 48 |
| 48 virtual void pinchGestureBegin() = 0; | 49 virtual void pinchGestureBegin() = 0; |
| 49 virtual void pinchGestureUpdate(float magnifyDelta, const IntPoint& anchor)
= 0; | 50 virtual void pinchGestureUpdate(float magnifyDelta, const IntPoint& anchor)
= 0; |
| 50 virtual void pinchGestureEnd() = 0; | 51 virtual void pinchGestureEnd() = 0; |
| 51 | 52 |
| 52 virtual void startPageScaleAnimation(const IntSize& targetPosition, | 53 virtual void startPageScaleAnimation(const IntSize& targetPosition, |
| 53 bool anchorPoint, | 54 bool anchorPoint, |
| 54 float pageScale, | 55 float pageScale, |
| 55 double startTime, | 56 base::TimeTicks startTime, |
| 56 double duration) = 0; | 57 base::TimeDelta duration) = 0; |
| 57 | 58 |
| 58 // Request another callback to InputHandler::animate(). | 59 // Request another callback to InputHandler::animate(). |
| 59 virtual void scheduleAnimation() = 0; | 60 virtual void scheduleAnimation() = 0; |
| 60 | 61 |
| 61 protected: | 62 protected: |
| 62 InputHandlerClient() { } | 63 InputHandlerClient() { } |
| 63 virtual ~InputHandlerClient() { } | 64 virtual ~InputHandlerClient() { } |
| 64 | 65 |
| 65 private: | 66 private: |
| 66 DISALLOW_COPY_AND_ASSIGN(InputHandlerClient); | 67 DISALLOW_COPY_AND_ASSIGN(InputHandlerClient); |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 class InputHandler { | 70 class InputHandler { |
| 70 public: | 71 public: |
| 71 virtual ~InputHandler() { } | 72 virtual ~InputHandler() { } |
| 72 | 73 |
| 73 virtual void bindToClient(InputHandlerClient*) = 0; | 74 virtual void bindToClient(InputHandlerClient*) = 0; |
| 74 virtual void animate(double monotonicTime) = 0; | 75 virtual void animate(base::TimeTicks time) = 0; |
| 75 | 76 |
| 76 protected: | 77 protected: |
| 77 InputHandler() { } | 78 InputHandler() { } |
| 78 | 79 |
| 79 private: | 80 private: |
| 80 DISALLOW_COPY_AND_ASSIGN(InputHandler); | 81 DISALLOW_COPY_AND_ASSIGN(InputHandler); |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } | 84 } |
| 84 | 85 |
| 85 #endif | 86 #endif |
| OLD | NEW |