зеркало из https://github.com/mozilla/gecko-dev.git
Bug 869940 - Implement pan start/end notifications from APZC. r=kats
This commit is contained in:
Родитель
de2bc57255
Коммит
9d6c1c0076
|
@ -1378,9 +1378,24 @@ void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) {
|
|||
}
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::SetState(PanZoomState aState) {
|
||||
void AsyncPanZoomController::SetState(PanZoomState aNewState) {
|
||||
|
||||
PanZoomState oldState;
|
||||
|
||||
// Intentional scoping for mutex
|
||||
{
|
||||
MonitorAutoLock monitor(mMonitor);
|
||||
mState = aState;
|
||||
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() {}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче