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

--HG--
extra : commitid : GvuSYOt7CxQ
This commit is contained in:
Kartikaya Gupta 2015-11-13 15:10:52 -05:00
Родитель 8b57a39a60
Коммит 6b4995e92f
3 изменённых файлов: 24 добавлений и 0 удалений

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

@ -28,6 +28,7 @@ class APZEventState;
// tree.
class ChromeProcessController : public mozilla::layers::GeckoContentController
{
protected:
typedef mozilla::layers::FrameMetrics FrameMetrics;
typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;

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

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

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

@ -32,6 +32,9 @@ public:
{}
// ChromeProcessController methods
void HandleSingleTap(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid) override;
void PostDelayedTask(Task* aTask, int aDelayMs) override;
public: