| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 syntheticWheel.y = m_positionOnFlingStart.y; | 617 syntheticWheel.y = m_positionOnFlingStart.y; |
| 618 syntheticWheel.globalX = m_globalPositionOnFlingStart.x; | 618 syntheticWheel.globalX = m_globalPositionOnFlingStart.x; |
| 619 syntheticWheel.globalY = m_globalPositionOnFlingStart.y; | 619 syntheticWheel.globalY = m_globalPositionOnFlingStart.y; |
| 620 syntheticWheel.modifiers = m_flingModifier; | 620 syntheticWheel.modifiers = m_flingModifier; |
| 621 | 621 |
| 622 if (m_page && m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()
&& m_page->deprecatedLocalMainFrame()->view()) | 622 if (m_page && m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()
&& m_page->deprecatedLocalMainFrame()->view()) |
| 623 return handleMouseWheel(*m_page->deprecatedLocalMainFrame(), synthet
icWheel); | 623 return handleMouseWheel(*m_page->deprecatedLocalMainFrame(), synthet
icWheel); |
| 624 } else { | 624 } else { |
| 625 WebGestureEvent syntheticGestureEvent; | 625 WebGestureEvent syntheticGestureEvent; |
| 626 | 626 |
| 627 syntheticGestureEvent.type = WebInputEvent::GestureScrollUpdateWithoutPr
opagation; | 627 syntheticGestureEvent.type = WebInputEvent::GestureScrollUpdate; |
| 628 syntheticGestureEvent.data.scrollUpdate.preventPropagation = true; |
| 628 syntheticGestureEvent.data.scrollUpdate.deltaX = delta.width; | 629 syntheticGestureEvent.data.scrollUpdate.deltaX = delta.width; |
| 629 syntheticGestureEvent.data.scrollUpdate.deltaY = delta.height; | 630 syntheticGestureEvent.data.scrollUpdate.deltaY = delta.height; |
| 630 syntheticGestureEvent.x = m_positionOnFlingStart.x; | 631 syntheticGestureEvent.x = m_positionOnFlingStart.x; |
| 631 syntheticGestureEvent.y = m_positionOnFlingStart.y; | 632 syntheticGestureEvent.y = m_positionOnFlingStart.y; |
| 632 syntheticGestureEvent.globalX = m_globalPositionOnFlingStart.x; | 633 syntheticGestureEvent.globalX = m_globalPositionOnFlingStart.x; |
| 633 syntheticGestureEvent.globalY = m_globalPositionOnFlingStart.y; | 634 syntheticGestureEvent.globalY = m_globalPositionOnFlingStart.y; |
| 634 syntheticGestureEvent.modifiers = m_flingModifier; | 635 syntheticGestureEvent.modifiers = m_flingModifier; |
| 635 syntheticGestureEvent.sourceDevice = WebGestureDeviceTouchscreen; | 636 syntheticGestureEvent.sourceDevice = WebGestureDeviceTouchscreen; |
| 636 | 637 |
| 637 if (m_page && m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()
&& m_page->deprecatedLocalMainFrame()->view()) | 638 if (m_page && m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()
&& m_page->deprecatedLocalMainFrame()->view()) |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1848 // Create synthetic wheel events as necessary for fling. | 1849 // Create synthetic wheel events as necessary for fling. |
| 1849 if (m_gestureAnimation) { | 1850 if (m_gestureAnimation) { |
| 1850 if (m_gestureAnimation->animate(validFrameTime.lastFrameTimeMonotonic)) | 1851 if (m_gestureAnimation->animate(validFrameTime.lastFrameTimeMonotonic)) |
| 1851 scheduleAnimation(); | 1852 scheduleAnimation(); |
| 1852 else { | 1853 else { |
| 1853 endActiveFlingAnimation(); | 1854 endActiveFlingAnimation(); |
| 1854 | 1855 |
| 1855 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, | 1856 PlatformGestureEvent endScrollEvent(PlatformEvent::GestureScrollEnd, |
| 1856 m_positionOnFlingStart, m_globalPositionOnFlingStart, | 1857 m_positionOnFlingStart, m_globalPositionOnFlingStart, |
| 1857 IntSize(), 0, false, false, false, false, | 1858 IntSize(), 0, false, false, false, false, |
| 1858 0, 0, 0, 0); | 1859 0, 0, 0, 0, false); |
| 1859 | 1860 |
| 1860 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); | 1861 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); |
| 1861 } | 1862 } |
| 1862 } | 1863 } |
| 1863 | 1864 |
| 1864 if (!m_page) | 1865 if (!m_page) |
| 1865 return; | 1866 return; |
| 1866 | 1867 |
| 1867 // FIXME: This should probably be using the local root? | 1868 // FIXME: This should probably be using the local root? |
| 1868 if (m_page->mainFrame()->isLocalFrame()) | 1869 if (m_page->mainFrame()->isLocalFrame()) |
| (...skipping 2609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4478 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4479 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4479 | 4480 |
| 4480 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4481 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4481 return false; | 4482 return false; |
| 4482 | 4483 |
| 4483 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4484 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4484 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4485 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4485 } | 4486 } |
| 4486 | 4487 |
| 4487 } // namespace blink | 4488 } // namespace blink |
| OLD | NEW |