Bug 1249943 - Make test_basic_pan work on Fennec and Linux as well. r=botond
This patch convers the APZ:TransformEnd notification from a MessageManager message to an observer notification so that it is more general and works on other platforms. MozReview-Commit-ID: 8SSir828Ch7
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "base/message_loop.h"
|
||||
#include "mozilla/layers/APZCCallbackHelper.h"
|
||||
#include "mozilla/layers/APZCTreeManager.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsWindow.h"
|
||||
|
||||
@@ -98,5 +99,23 @@ AndroidContentController::UpdateOverscrollOffset(const float aX,const float aY)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
AndroidContentController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
||||
APZStateChange aChange,
|
||||
int aArg)
|
||||
{
|
||||
// This function may get invoked twice, if the first invocation is not on
|
||||
// the main thread then the ChromeProcessController version of this function
|
||||
// will redispatch to the main thread. We want to make sure that our handling
|
||||
// only happens on the main thread.
|
||||
ChromeProcessController::NotifyAPZStateChange(aGuid, aChange, aArg);
|
||||
if (NS_IsMainThread() && aChange == layers::GeckoContentController::APZStateChange::TransformEnd) {
|
||||
// This is used by tests to determine when the APZ is done doing whatever
|
||||
// it's doing. XXX generify this as needed when writing additional tests.
|
||||
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
|
||||
observerService->NotifyObservers(nullptr, "APZ:TransformEnd", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace widget
|
||||
} // namespace mozilla
|
||||
|
||||
Reference in New Issue
Block a user