| 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 CC_INPUT_INPUT_HANDLER_H_ | 5 #ifndef CC_INPUT_INPUT_HANDLER_H_ |
| 6 #define CC_INPUT_INPUT_HANDLER_H_ | 6 #define CC_INPUT_INPUT_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Selects a layer to be scrolled at a given point in viewport (logical | 34 // Selects a layer to be scrolled at a given point in viewport (logical |
| 35 // pixel) coordinates. Returns ScrollStarted if the layer at the coordinates | 35 // pixel) coordinates. Returns ScrollStarted if the layer at the coordinates |
| 36 // can be scrolled, ScrollOnMainThread if the scroll event should instead be | 36 // can be scrolled, ScrollOnMainThread if the scroll event should instead be |
| 37 // delegated to the main thread, or ScrollIgnored if there is nothing to be | 37 // delegated to the main thread, or ScrollIgnored if there is nothing to be |
| 38 // scrolled at the given coordinates. | 38 // scrolled at the given coordinates. |
| 39 virtual ScrollStatus ScrollBegin(gfx::Point viewport_point, | 39 virtual ScrollStatus ScrollBegin(gfx::Point viewport_point, |
| 40 ScrollInputType type) = 0; | 40 ScrollInputType type) = 0; |
| 41 | 41 |
| 42 // Scroll the selected layer starting at the given position. If the scroll | 42 // Scroll the selected layer starting at the given position. If the scroll |
| 43 // type given to scrollBegin was a gesture, then the scroll point and delta | 43 // type given to ScrollBegin was a gesture, then the scroll point and delta |
| 44 // should be in viewport (logical pixel) coordinates. Otherwise they are in | 44 // should be in viewport (logical pixel) coordinates. Otherwise they are in |
| 45 // scrolling layer's (logical pixel) space. If there is no room to move the | 45 // scrolling layer's (logical pixel) space. If there is no room to move the |
| 46 // layer in the requested direction, its first ancestor layer that can be | 46 // layer in the requested direction, its first ancestor layer that can be |
| 47 // scrolled will be moved instead. If no layer can be moved in the requested | 47 // scrolled will be moved instead. If no layer can be moved in the requested |
| 48 // direction at all, then false is returned. If any layer is moved, then | 48 // direction at all, then false is returned. If any layer is moved, then |
| 49 // true is returned. | 49 // true is returned. |
| 50 // Should only be called if ScrollBegin() returned ScrollStarted. | 50 // Should only be called if ScrollBegin() returned ScrollStarted. |
| 51 virtual bool ScrollBy(gfx::Point viewport_point, | 51 virtual bool ScrollBy(gfx::Point viewport_point, |
| 52 gfx::Vector2dF scroll_delta) = 0; | 52 gfx::Vector2dF scroll_delta) = 0; |
| 53 | 53 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 protected: | 89 protected: |
| 90 InputHandler() {} | 90 InputHandler() {} |
| 91 | 91 |
| 92 private: | 92 private: |
| 93 DISALLOW_COPY_AND_ASSIGN(InputHandler); | 93 DISALLOW_COPY_AND_ASSIGN(InputHandler); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace cc | 96 } // namespace cc |
| 97 | 97 |
| 98 #endif // CC_INPUT_INPUT_HANDLER_H_ | 98 #endif // CC_INPUT_INPUT_HANDLER_H_ |
| OLD | NEW |