Bug 1208944 - Part 5. Send PluginEvent to content process. r=jmathies

This commit is contained in:
Makoto Kato 2015-12-29 22:57:38 +09:00
parent a4309e941a
commit 4ac6c97dcd
5 changed files with 31 additions and 0 deletions

View File

@ -1210,6 +1210,10 @@ EventStateManager::DispatchCrossProcessEvent(WidgetEvent* aEvent,
return retval;
}
case ePluginEventClass: {
*aStatus = nsEventStatus_eConsumeNoDefault;
return remote->SendPluginEvent(*aEvent->AsPluginEvent());
}
default: {
MOZ_CRASH("Attempt to send non-whitelisted event?");
}

View File

@ -52,6 +52,7 @@ using class mozilla::WidgetDragEvent from "ipc/nsGUIEventIPC.h";
using struct nsRect from "nsRect.h";
using class mozilla::WidgetSelectionEvent from "ipc/nsGUIEventIPC.h";
using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
using class mozilla::WidgetPluginEvent from "ipc/nsGUIEventIPC.h";
using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h";
using mozilla::dom::ScreenOrientationInternal from "mozilla/dom/ScreenOrientation.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
@ -634,6 +635,7 @@ child:
uint64_t aInputBlockId,
nsEventStatus aApzResponse);
RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction, uint32_t aDropEffect);
PluginEvent(WidgetPluginEvent aEvent);
/**
* @see nsIDOMWindowUtils sendKeyEvent.

View File

@ -1943,6 +1943,16 @@ TabChild::RecvRealDragEvent(const WidgetDragEvent& aEvent,
return true;
}
bool
TabChild::RecvPluginEvent(const WidgetPluginEvent& aEvent)
{
WidgetPluginEvent localEvent(aEvent);
localEvent.widget = mPuppetWidget;
APZCCallbackHelper::DispatchWidgetEvent(localEvent);
// XXX If not consumed, we should call default action (ex. DefWindowProc)?
return true;
}
void
TabChild::RequestNativeKeyBindings(AutoCacheNativeKeyCommands* aAutoCache,
WidgetKeyboardEvent* aEvent)

View File

@ -379,6 +379,7 @@ public:
const nsString& aEvent) override;
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
const nsCString& aResponse) override;
virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override;
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) override;
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) override;
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) override;

View File

@ -15,6 +15,11 @@
namespace mozilla {
namespace dom {
class PBrowserParent;
class PBrowserChild;
} // namespace dom
/******************************************************************************
* mozilla::WidgetContentCommandEvent
******************************************************************************/
@ -142,6 +147,10 @@ public:
class WidgetPluginEvent : public WidgetGUIEvent
{
private:
friend class dom::PBrowserParent;
friend class dom::PBrowserChild;
public:
virtual WidgetPluginEvent* AsPluginEvent() override { return this; }
@ -175,6 +184,11 @@ public:
retargetToFocusedDocument = aEvent.retargetToFocusedDocument;
}
protected:
WidgetPluginEvent()
{
}
};
} // namespace mozilla