| 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/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 private: | 44 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(InputHandlerClient); | 45 DISALLOW_COPY_AND_ASSIGN(InputHandlerClient); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 // The InputHandler is a way for the embedders to interact with the impl thread | 48 // The InputHandler is a way for the embedders to interact with the impl thread |
| 49 // side of the compositor implementation. There is one InputHandler per | 49 // side of the compositor implementation. There is one InputHandler per |
| 50 // LayerTreeHost. To use the input handler, implement the InputHanderClient | 50 // LayerTreeHost. To use the input handler, implement the InputHanderClient |
| 51 // interface and bind it to the handler on the compositor thread. | 51 // interface and bind it to the handler on the compositor thread. |
| 52 class CC_EXPORT InputHandler { | 52 class CC_EXPORT InputHandler { |
| 53 public: | 53 public: |
| 54 enum ScrollStatus { ScrollOnMainThread, ScrollStarted, ScrollIgnored }; | 54 // Note these are used in a histogram. Do not reorder or delete existing |
| 55 // entries. |
| 56 enum ScrollStatus { |
| 57 ScrollOnMainThread = 0, |
| 58 ScrollStarted, |
| 59 ScrollIgnored, |
| 60 ScrollUnknown, |
| 61 // This must be the last entry. |
| 62 ScrollStatusCount |
| 63 }; |
| 55 enum ScrollInputType { Gesture, Wheel, NonBubblingGesture }; | 64 enum ScrollInputType { Gesture, Wheel, NonBubblingGesture }; |
| 56 | 65 |
| 57 // Binds a client to this handler to receive notifications. Only one client | 66 // Binds a client to this handler to receive notifications. Only one client |
| 58 // can be bound to an InputHandler. The client must live at least until the | 67 // can be bound to an InputHandler. The client must live at least until the |
| 59 // handler calls WillShutdown() on the client. | 68 // handler calls WillShutdown() on the client. |
| 60 virtual void BindToClient(InputHandlerClient* client) = 0; | 69 virtual void BindToClient(InputHandlerClient* client) = 0; |
| 61 | 70 |
| 62 // Selects a layer to be scrolled at a given point in viewport (logical | 71 // Selects a layer to be scrolled at a given point in viewport (logical |
| 63 // pixel) coordinates. Returns ScrollStarted if the layer at the coordinates | 72 // pixel) coordinates. Returns ScrollStarted if the layer at the coordinates |
| 64 // can be scrolled, ScrollOnMainThread if the scroll event should instead be | 73 // can be scrolled, ScrollOnMainThread if the scroll event should instead be |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 InputHandler() {} | 141 InputHandler() {} |
| 133 virtual ~InputHandler() {} | 142 virtual ~InputHandler() {} |
| 134 | 143 |
| 135 private: | 144 private: |
| 136 DISALLOW_COPY_AND_ASSIGN(InputHandler); | 145 DISALLOW_COPY_AND_ASSIGN(InputHandler); |
| 137 }; | 146 }; |
| 138 | 147 |
| 139 } // namespace cc | 148 } // namespace cc |
| 140 | 149 |
| 141 #endif // CC_INPUT_INPUT_HANDLER_H_ | 150 #endif // CC_INPUT_INPUT_HANDLER_H_ |
| OLD | NEW |