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:
Jim Chen 2016-03-22 22:24:31 -04:00
Родитель 684d4be80d
Коммит 92c9a70aa5
1 изменённых файлов: 11 добавлений и 3 удалений

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

@ -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);