Bug 869940 - Implement pan start/end notifications from APZC. r=kats

This commit is contained in:
Brian R. Bondy 2013-07-25 13:15:06 -04:00
parent 5b157af303
commit 98b679c2f8
2 changed files with 29 additions and 3 deletions

View File

@ -1378,9 +1378,24 @@ void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) {
}
}
void AsyncPanZoomController::SetState(PanZoomState aState) {
MonitorAutoLock monitor(mMonitor);
mState = aState;
void AsyncPanZoomController::SetState(PanZoomState aNewState) {
PanZoomState oldState;
// Intentional scoping for mutex
{
MonitorAutoLock monitor(mMonitor);
oldState = mState;
mState = aNewState;
}
if (mGeckoContentController) {
if (oldState == PANNING && aNewState != PANNING) {
mGeckoContentController->HandlePanEnd();
} else if (oldState != PANNING && aNewState == PANNING) {
mGeckoContentController->HandlePanBegin();
}
}
}
void AsyncPanZoomController::TimeoutTouchListeners() {

View File

@ -60,6 +60,17 @@ public:
*/
virtual void PostDelayedTask(Task* aTask, int aDelayMs) = 0;
/**
* Request any special actions be performed when panning starts
*/
virtual void HandlePanBegin() {}
/**
* Request any special actions be performed when panning ends
*/
virtual void HandlePanEnd() {}
GeckoContentController() {}
virtual ~GeckoContentController() {}
};