OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 m_positionOnFlingStart = WebPoint(event.x, event.y); | 700 m_positionOnFlingStart = WebPoint(event.x, event.y); |
701 m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY); | 701 m_globalPositionOnFlingStart = WebPoint(event.globalX, event.globalY); |
702 m_flingModifier = event.modifiers; | 702 m_flingModifier = event.modifiers; |
703 m_flingSourceDevice = event.sourceDevice; | 703 m_flingSourceDevice = event.sourceDevice; |
704 OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->creat
eFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.vel
ocityX, event.data.flingStart.velocityY), WebSize())); | 704 OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->creat
eFlingAnimationCurve(event.sourceDevice, WebFloatPoint(event.data.flingStart.vel
ocityX, event.data.flingStart.velocityY), WebSize())); |
705 ASSERT(flingCurve); | 705 ASSERT(flingCurve); |
706 m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(f
lingCurve.release(), this); | 706 m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(f
lingCurve.release(), this); |
707 scheduleAnimation(); | 707 scheduleAnimation(); |
708 eventSwallowed = true; | 708 eventSwallowed = true; |
709 | 709 |
| 710 // Plugins may need to see GestureFlingStart to balance |
| 711 // GestureScrollBegin (since the former replaces GestureScrollEnd when |
| 712 // transitioning to a fling). |
| 713 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(),
event); |
| 714 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEvent(platfo
rmEvent); |
| 715 |
710 m_client->didHandleGestureEvent(event, eventCancelled); | 716 m_client->didHandleGestureEvent(event, eventCancelled); |
711 return eventSwallowed; | 717 return eventSwallowed; |
712 } | 718 } |
713 case WebInputEvent::GestureFlingCancel: | 719 case WebInputEvent::GestureFlingCancel: |
714 if (endActiveFlingAnimation()) | 720 if (endActiveFlingAnimation()) |
715 eventSwallowed = true; | 721 eventSwallowed = true; |
716 | 722 |
717 m_client->didHandleGestureEvent(event, eventCancelled); | 723 m_client->didHandleGestureEvent(event, eventCancelled); |
718 return eventSwallowed; | 724 return eventSwallowed; |
719 default: | 725 default: |
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 // Create synthetic wheel events as necessary for fling. | 1863 // Create synthetic wheel events as necessary for fling. |
1858 if (m_gestureAnimation) { | 1864 if (m_gestureAnimation) { |
1859 if (m_gestureAnimation->animate(validFrameTime.lastFrameTimeMonotonic)) | 1865 if (m_gestureAnimation->animate(validFrameTime.lastFrameTimeMonotonic)) |
1860 scheduleAnimation(); | 1866 scheduleAnimation(); |
1861 else { | 1867 else { |
1862 endActiveFlingAnimation(); | 1868 endActiveFlingAnimation(); |
1863 | 1869 |
1864 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, | 1870 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, |
1865 m_positionOnFlingStart, m_globalPositionOnFlingStart, | 1871 m_positionOnFlingStart, m_globalPositionOnFlingStart, |
1866 IntSize(), 0, false, false, false, false); | 1872 IntSize(), 0, false, false, false, false); |
1867 endScrollEvent.setScrollGestureData(0, 0, 0, 0, true, false); | 1873 endScrollEvent.setScrollGestureData(0, 0, 0, 0, true, false, -1 /* n
ull plugin id */); |
1868 | 1874 |
1869 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); | 1875 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); |
1870 } | 1876 } |
1871 } | 1877 } |
1872 | 1878 |
1873 if (!m_page) | 1879 if (!m_page) |
1874 return; | 1880 return; |
1875 | 1881 |
1876 // FIXME: This should probably be using the local root? | 1882 // FIXME: This should probably be using the local root? |
1877 if (m_page->mainFrame()->isLocalFrame()) | 1883 if (m_page->mainFrame()->isLocalFrame()) |
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4419 if (m_pageColorOverlay) | 4425 if (m_pageColorOverlay) |
4420 m_pageColorOverlay->update(); | 4426 m_pageColorOverlay->update(); |
4421 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { | 4427 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { |
4422 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); | 4428 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
4423 if (inspectorPageOverlay) | 4429 if (inspectorPageOverlay) |
4424 inspectorPageOverlay->update(); | 4430 inspectorPageOverlay->update(); |
4425 } | 4431 } |
4426 } | 4432 } |
4427 | 4433 |
4428 } // namespace blink | 4434 } // namespace blink |
OLD | NEW |