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