summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
commit8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch)
tree17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
parentb9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff)
downloadqtwebkit-8995b83bcbfbb68245f779b64e5517627c6cc6ea.tar.gz
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
Diffstat (limited to 'Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp')
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp b/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
index 0aaa06690..a9c4e7a00 100644
--- a/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtPanGestureRecognizer.cpp
@@ -38,9 +38,6 @@ QtPanGestureRecognizer::QtPanGestureRecognizer(QtWebPageEventHandler* eventHandl
bool QtPanGestureRecognizer::update(const QTouchEvent::TouchPoint& touchPoint, qint64 eventTimestampMillis)
{
- if (!viewportController())
- return false;
-
m_lastPosition = touchPoint.pos();
m_lastEventTimestampMillis = eventTimestampMillis;
@@ -48,7 +45,8 @@ bool QtPanGestureRecognizer::update(const QTouchEvent::TouchPoint& touchPoint, q
case NoGesture:
m_state = GestureRecognitionStarted;
m_firstScreenPosition = touchPoint.screenPos();
- viewportController()->cancelScrollAnimation();
+ if (viewportController())
+ viewportController()->cancelScrollAnimation();
return false;
case GestureRecognitionStarted: {
// To start the gesture, the delta from start in screen coordinates
@@ -58,11 +56,13 @@ bool QtPanGestureRecognizer::update(const QTouchEvent::TouchPoint& touchPoint, q
return false;
m_state = GestureRecognized;
- viewportController()->panGestureStarted(touchPoint.pos(), eventTimestampMillis);
+ if (viewportController())
+ viewportController()->panGestureStarted(touchPoint.pos(), eventTimestampMillis);
return true;
}
case GestureRecognized:
- viewportController()->panGestureRequestUpdate(touchPoint.pos(), eventTimestampMillis);
+ if (viewportController())
+ viewportController()->panGestureRequestUpdate(touchPoint.pos(), eventTimestampMillis);
return true;
default:
ASSERT_NOT_REACHED();
@@ -75,8 +75,8 @@ void QtPanGestureRecognizer::finish(const QTouchEvent::TouchPoint& touchPoint, q
if (m_state == NoGesture)
return;
- ASSERT(viewportController());
- viewportController()->panGestureEnded(touchPoint.pos(), eventTimestampMillis);
+ if (viewportController())
+ viewportController()->panGestureEnded(touchPoint.pos(), eventTimestampMillis);
reset();
}
@@ -85,8 +85,10 @@ void QtPanGestureRecognizer::cancel()
if (m_state == NoGesture)
return;
- viewportController()->panGestureEnded(m_lastPosition, m_lastEventTimestampMillis);
- viewportController()->panGestureCancelled();
+ if (viewportController()) {
+ viewportController()->panGestureEnded(m_lastPosition, m_lastEventTimestampMillis);
+ viewportController()->panGestureCancelled();
+ }
reset();
}