Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 1308313005: Modify gesture event types for WebView-tag scroll bubbling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleanup asserts. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after
4411 if (m_pageColorOverlay) 4417 if (m_pageColorOverlay)
4412 m_pageColorOverlay->update(); 4418 m_pageColorOverlay->update();
4413 if (InspectorOverlayImpl* overlay = inspectorOverlay()) { 4419 if (InspectorOverlayImpl* overlay = inspectorOverlay()) {
4414 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); 4420 PageOverlay* inspectorPageOverlay = overlay->pageOverlay();
4415 if (inspectorPageOverlay) 4421 if (inspectorPageOverlay)
4416 inspectorPageOverlay->update(); 4422 inspectorPageOverlay->update();
4417 } 4423 }
4418 } 4424 }
4419 4425
4420 } // namespace blink 4426 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698