OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 const WebMouseWheelEvent& wheelEvent = *static_cast<const WebMouseWheelE
vent*>(&event); | 180 const WebMouseWheelEvent& wheelEvent = *static_cast<const WebMouseWheelE
vent*>(&event); |
181 CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->
scrollBegin(IntPoint(wheelEvent.x, wheelEvent.y), CCInputHandlerClient::Wheel); | 181 CCInputHandlerClient::ScrollStatus scrollStatus = m_inputHandlerClient->
scrollBegin(IntPoint(wheelEvent.x, wheelEvent.y), CCInputHandlerClient::Wheel); |
182 switch (scrollStatus) { | 182 switch (scrollStatus) { |
183 case CCInputHandlerClient::ScrollStarted: { | 183 case CCInputHandlerClient::ScrollStarted: { |
184 TRACE_EVENT_INSTANT2("cc", "WebCompositorInputHandlerImpl::handleInp
ut wheel scroll", "deltaX", -wheelEvent.deltaX, "deltaY", -wheelEvent.deltaY); | 184 TRACE_EVENT_INSTANT2("cc", "WebCompositorInputHandlerImpl::handleInp
ut wheel scroll", "deltaX", -wheelEvent.deltaX, "deltaY", -wheelEvent.deltaY); |
185 m_inputHandlerClient->scrollBy(IntSize(-wheelEvent.deltaX, -wheelEve
nt.deltaY)); | 185 m_inputHandlerClient->scrollBy(IntSize(-wheelEvent.deltaX, -wheelEve
nt.deltaY)); |
186 m_inputHandlerClient->scrollEnd(); | 186 m_inputHandlerClient->scrollEnd(); |
187 return DidHandle; | 187 return DidHandle; |
188 } | 188 } |
189 case CCInputHandlerClient::ScrollIgnored: | 189 case CCInputHandlerClient::ScrollIgnored: |
190 return DropEvent; | 190 // FIXME: This should be DropEvent, but in cases where we fail to pr
operly sync scrollability it's safer to send the |
| 191 // event to the main thread. Change back to DropEvent once we have s
ynchronization bugs sorted out. |
| 192 return DidNotHandle; |
191 case CCInputHandlerClient::ScrollFailed: | 193 case CCInputHandlerClient::ScrollFailed: |
192 return DidNotHandle; | 194 return DidNotHandle; |
193 } | 195 } |
194 } else if (event.type == WebInputEvent::GestureScrollBegin) { | 196 } else if (event.type == WebInputEvent::GestureScrollBegin) { |
195 ASSERT(!m_gestureScrollStarted); | 197 ASSERT(!m_gestureScrollStarted); |
196 ASSERT(!m_expectScrollUpdateEnd); | 198 ASSERT(!m_expectScrollUpdateEnd); |
197 #ifndef NDEBUG | 199 #ifndef NDEBUG |
198 m_expectScrollUpdateEnd = true; | 200 m_expectScrollUpdateEnd = true; |
199 #endif | 201 #endif |
200 const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent
*>(&event); | 202 const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent
*>(&event); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 // thread and run the rest of the wheels from there. | 342 // thread and run the rest of the wheels from there. |
341 // This can happen when flinging a page that contains a scrollable subar
ea that we can't | 343 // This can happen when flinging a page that contains a scrollable subar
ea that we can't |
342 // scroll on the thread if the fling starts outside the subarea but then
is flung "under" the | 344 // scroll on the thread if the fling starts outside the subarea but then
is flung "under" the |
343 // pointer. | 345 // pointer. |
344 // For now, just abort the fling. | 346 // For now, just abort the fling. |
345 cancelCurrentFling(); | 347 cancelCurrentFling(); |
346 } | 348 } |
347 } | 349 } |
348 | 350 |
349 } | 351 } |
OLD | NEW |