зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1257319 - Don't use broadcast event in AndroidContentController; r=rbarker
We should use observer service directly instead of broadcast event.
This commit is contained in:
Родитель
684d4be80d
Коммит
92c9a70aa5
|
@ -70,9 +70,17 @@ AndroidContentController::HandleSingleTap(const CSSPoint& aPoint,
|
|||
}
|
||||
|
||||
CSSIntPoint rounded = RoundedToInt(point);
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", rounded.x, rounded.y);
|
||||
nsAppShell::PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
|
||||
nsAppShell::PostEvent([rounded] {
|
||||
nsCOMPtr<nsIObserverService> obsServ =
|
||||
mozilla::services::GetObserverService();
|
||||
if (!obsServ) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsPrintfCString data("{\"x\":%d,\"y\":%d}", rounded.x, rounded.y);
|
||||
obsServ->NotifyObservers(nullptr, "Gesture:SingleTap",
|
||||
NS_ConvertASCIItoUTF16(data).get());
|
||||
});
|
||||
}
|
||||
|
||||
ChromeProcessController::HandleSingleTap(aPoint, aModifiers, aGuid);
|
||||
|
|
Загрузка…
Ссылка в новой задаче