mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-01 12:03:08 +00:00
Bug 839641 - Implement handling for APZC-reported gestures. r=Cwiiis
This commit is contained in:
parent
5d262f9292
commit
6968125e22
@ -34,6 +34,7 @@
|
||||
#include "nsIDOMClientRect.h"
|
||||
#include "StrongPointer.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ALOG_BRIDGE(args...) ALOG(args)
|
||||
@ -2724,19 +2725,25 @@ AndroidBridge::RequestContentRepaint(const mozilla::layers::FrameMetrics& aFrame
|
||||
void
|
||||
AndroidBridge::HandleDoubleTap(const nsIntPoint& aPoint)
|
||||
{
|
||||
// FIXME implement this
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:DoubleTap"), data));
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::HandleSingleTap(const nsIntPoint& aPoint)
|
||||
{
|
||||
// FIXME implement this
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::HandleLongTap(const nsIntPoint& aPoint)
|
||||
{
|
||||
// FIXME implement this
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:LongPress"), data));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -516,6 +516,14 @@ public:
|
||||
return event;
|
||||
}
|
||||
|
||||
static AndroidGeckoEvent* MakeBroadcastEvent(const nsCString& topic, const nsCString& data) {
|
||||
AndroidGeckoEvent* event = new AndroidGeckoEvent();
|
||||
event->Init(BROADCAST);
|
||||
CopyUTF8toUTF16(topic, event->mCharacters);
|
||||
CopyUTF8toUTF16(data, event->mCharactersExtra);
|
||||
return event;
|
||||
}
|
||||
|
||||
int Action() { return mAction; }
|
||||
int Type() { return mType; }
|
||||
bool AckNeeded() { return mAckNeeded; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user