Bug 1223296 - Fire a Gesture:SingleTap message to browser.js even on the C++ APZ codepath. r=rbarker

This commit is contained in:
Kartikaya Gupta
2015-11-13 15:10:52 -05:00
parent 423871204e
commit 0b28b640ef
3 changed files with 24 additions and 0 deletions

View File

@@ -46,6 +46,26 @@ AndroidContentController::NotifyDefaultPrevented(uint64_t aInputBlockId,
}
}
void
AndroidContentController::HandleSingleTap(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid)
{
// This function will get invoked first on the Java UI thread, and then
// again on the main thread (because of the code in ChromeProcessController::
// HandleSingleTap). We want to post the SingleTap message once; it can be
// done from either thread but for backwards compatibility with the JPZC
// architecture it's better to do it as soon as possible.
if (AndroidBridge::IsJavaUiThread()) {
CSSIntPoint point = RoundedToInt(aPoint);
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", point.x, point.y);
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
}
ChromeProcessController::HandleSingleTap(aPoint, aModifiers, aGuid);
}
void
AndroidContentController::PostDelayedTask(Task* aTask, int aDelayMs)
{