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
Родитель de2bc57255
Коммит 9d6c1c0076
2 изменённых файлов: 29 добавлений и 3 удалений

Просмотреть файл

@ -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() {

Просмотреть файл

@ -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() {}
};