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

Unified Diff: Source/WebCore/page/AutoscrollController.cpp

Issue 12040032: Merge 140104 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/page/AutoscrollController.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/page/AutoscrollController.cpp
===================================================================
--- Source/WebCore/page/AutoscrollController.cpp (revision 140488)
+++ Source/WebCore/page/AutoscrollController.cpp (working copy)
@@ -53,10 +53,6 @@
: m_autoscrollTimer(this, &AutoscrollController::autoscrollTimerFired)
, m_autoscrollRenderer(0)
, m_autoscrollType(NoAutoscroll)
-#if ENABLE(PAN_SCROLLING)
- , m_panScrollButtonPressed(false)
- , m_springLoadedPanScrollInProgress(false)
-#endif
{
}
@@ -89,10 +85,6 @@
m_autoscrollTimer.stop();
m_autoscrollType = NoAutoscroll;
m_autoscrollRenderer = 0;
-#if ENABLE(PAN_SCROLLING)
- m_panScrollButtonPressed = false;
- m_springLoadedPanScrollInProgress = false;
-#endif
if (!scrollable)
return;
@@ -157,15 +149,20 @@
void AutoscrollController::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
{
- if (mouseEvent.button() == MiddleButton)
- m_panScrollButtonPressed = false;
- if (m_springLoadedPanScrollInProgress)
+ switch (m_autoscrollType) {
+ case AutoscrollForPan:
+ if (mouseEvent.button() == MiddleButton)
+ m_autoscrollType = AutoscrollForPanCanStop;
+ break;
+ case AutoscrollForPanCanStop:
stopAutoscrollTimer();
+ break;
+ }
}
bool AutoscrollController::panScrollInProgress() const
{
- return m_autoscrollType == AutoscrollForPan;
+ return m_autoscrollType == AutoscrollForPan || m_autoscrollType == AutoscrollForPanCanStop;
}
void AutoscrollController::startPanScrolling(RenderBox* scrollable, const IntPoint& lastKnownMousePosition)
@@ -177,7 +174,6 @@
m_autoscrollType = AutoscrollForPan;
m_autoscrollRenderer = scrollable;
m_panScrollStartPos = lastKnownMousePosition;
- m_springLoadedPanScrollInProgress = false;
if (FrameView* view = scrollable->frame()->view())
view->addPanScrollIcon(lastKnownMousePosition);
@@ -210,6 +206,7 @@
case NoAutoscroll:
break;
#if ENABLE(PAN_SCROLLING)
+ case AutoscrollForPanCanStop:
case AutoscrollForPan:
// we verify that the main frame hasn't received the order to stop the panScroll
if (Frame* mainFrame = getMainFrame(frame)) {
@@ -241,8 +238,8 @@
bool north = m_panScrollStartPos.y() > (lastKnownMousePosition.y() + ScrollView::noPanScrollRadius);
bool south = m_panScrollStartPos.y() < (lastKnownMousePosition.y() - ScrollView::noPanScrollRadius);
- if ((east || west || north || south) && m_panScrollButtonPressed)
- m_springLoadedPanScrollInProgress = true;
+ if (m_autoscrollType == AutoscrollForPan && (east || west || north || south))
+ m_autoscrollType = AutoscrollForPanCanStop;
if (north) {
if (east)
« no previous file with comments | « Source/WebCore/page/AutoscrollController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698