| 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_HANDLER_H_ | 5 #ifndef CC_INPUT_HANDLER_H_ |
| 6 #define CC_INPUT_HANDLER_H_ | 6 #define CC_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/cc_export.h" | 10 #include "cc/cc_export.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // the impl thread side of the compositor implementation. | 21 // the impl thread side of the compositor implementation. |
| 22 // | 22 // |
| 23 // There is one InputHandler for every LayerTreeHost. It is | 23 // There is one InputHandler for every LayerTreeHost. It is |
| 24 // created on the main thread and used only on the impl thread. | 24 // created on the main thread and used only on the impl thread. |
| 25 // | 25 // |
| 26 // The InputHandler is constructed with a InputHandlerClient, which is the | 26 // The InputHandler is constructed with a InputHandlerClient, which is the |
| 27 // interface by which the handler can manipulate the LayerTree. | 27 // interface by which the handler can manipulate the LayerTree. |
| 28 class CC_EXPORT InputHandlerClient { | 28 class CC_EXPORT InputHandlerClient { |
| 29 public: | 29 public: |
| 30 enum ScrollStatus { ScrollOnMainThread, ScrollStarted, ScrollIgnored }; | 30 enum ScrollStatus { ScrollOnMainThread, ScrollStarted, ScrollIgnored }; |
| 31 enum ScrollInputType { Gesture, Wheel }; | 31 enum ScrollInputType { Gesture, Wheel, NonBubblingGesture }; |
| 32 | 32 |
| 33 // Selects a layer to be scrolled at a given point in viewport (logical | 33 // Selects a layer to be scrolled at a given point in viewport (logical |
| 34 // pixel) coordinates. Returns ScrollStarted if the layer at the coordinates | 34 // pixel) coordinates. Returns ScrollStarted if the layer at the coordinates |
| 35 // can be scrolled, ScrollOnMainThread if the scroll event should instead be | 35 // can be scrolled, ScrollOnMainThread if the scroll event should instead be |
| 36 // delegated to the main thread, or ScrollIgnored if there is nothing to be | 36 // delegated to the main thread, or ScrollIgnored if there is nothing to be |
| 37 // scrolled at the given coordinates. | 37 // scrolled at the given coordinates. |
| 38 virtual ScrollStatus scrollBegin(gfx::Point, ScrollInputType) = 0; | 38 virtual ScrollStatus scrollBegin(gfx::Point, ScrollInputType) = 0; |
| 39 | 39 |
| 40 // Scroll the selected layer starting at the given position. If the scroll | 40 // Scroll the selected layer starting at the given position. If the scroll |
| 41 // type given to scrollBegin was a gesture, then the scroll point and delta | 41 // type given to scrollBegin was a gesture, then the scroll point and delta |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 protected: | 86 protected: |
| 87 InputHandler() { } | 87 InputHandler() { } |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 DISALLOW_COPY_AND_ASSIGN(InputHandler); | 90 DISALLOW_COPY_AND_ASSIGN(InputHandler); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } | 93 } |
| 94 | 94 |
| 95 #endif // CC_INPUT_HANDLER_H_ | 95 #endif // CC_INPUT_HANDLER_H_ |
| OLD | NEW |