OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "third_party/WebKit/public/web/WebInputEvent.h" | 10 #include "third_party/WebKit/public/web/WebInputEvent.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Returns true to indicate that dispatching the event should reset the | 84 // Returns true to indicate that dispatching the event should reset the |
85 // overscroll gesture status. | 85 // overscroll gesture status. |
86 bool DispatchEventResetsState(const blink::WebInputEvent& event) const; | 86 bool DispatchEventResetsState(const blink::WebInputEvent& event) const; |
87 | 87 |
88 // Processes an event to update the internal state for overscroll. Returns | 88 // Processes an event to update the internal state for overscroll. Returns |
89 // true if the state is updated, false otherwise. | 89 // true if the state is updated, false otherwise. |
90 bool ProcessEventForOverscroll(const blink::WebInputEvent& event); | 90 bool ProcessEventForOverscroll(const blink::WebInputEvent& event); |
91 | 91 |
92 // Processes horizontal overscroll. This can update both the overscroll mode | 92 // Processes horizontal overscroll. This can update both the overscroll mode |
93 // and the over scroll amount (i.e. |overscroll_mode_|, |overscroll_delta_x_| | 93 // and the over scroll amount (i.e. |overscroll_mode_|, |overscroll_delta_x_| |
94 // and |overscroll_delta_y_|). | 94 // and |overscroll_delta_y_|). Returns true if overscroll was handled by the |
95 void ProcessOverscroll(float delta_x, | 95 // delegate. |
| 96 bool ProcessOverscroll(float delta_x, |
96 float delta_y, | 97 float delta_y, |
97 blink::WebInputEvent::Type event_type); | 98 blink::WebInputEvent::Type event_type); |
98 | 99 |
99 // Completes the desired action from the current gesture. | 100 // Completes the desired action from the current gesture. |
100 void CompleteAction(); | 101 void CompleteAction(); |
101 | 102 |
102 // Sets the overscroll mode (and triggers callback in the delegate when | 103 // Sets the overscroll mode (and triggers callback in the delegate when |
103 // appropriate). | 104 // appropriate). |
104 void SetOverscrollMode(OverscrollMode new_mode); | 105 void SetOverscrollMode(OverscrollMode new_mode); |
105 | 106 |
(...skipping 15 matching lines...) Expand all Loading... |
121 // The delegate that receives the overscroll updates. The delegate is not | 122 // The delegate that receives the overscroll updates. The delegate is not |
122 // owned by this controller. | 123 // owned by this controller. |
123 OverscrollControllerDelegate* delegate_; | 124 OverscrollControllerDelegate* delegate_; |
124 | 125 |
125 DISALLOW_COPY_AND_ASSIGN(OverscrollController); | 126 DISALLOW_COPY_AND_ASSIGN(OverscrollController); |
126 }; | 127 }; |
127 | 128 |
128 } // namespace content | 129 } // namespace content |
129 | 130 |
130 #endif // CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_H_ | 131 #endif // CONTENT_BROWSER_RENDERER_HOST_OVERSCROLL_CONTROLLER_H_ |
OLD | NEW |