Bug 602787 part.8 Don't implement nsWindowBase::DispatchPluginEvent() in windows/nsWindowBase.h r=jimm

This commit is contained in:
Masayuki Nakano 2013-10-22 22:27:35 +09:00
parent 9e0cc70277
commit b251169d52
5 changed files with 35 additions and 19 deletions

View File

@ -11,7 +11,7 @@
#include "nsString.h"
#include "nsWindowBase.h"
#include "nsWindowDefs.h"
#include "mozilla/EventForwards.h"
#include "mozilla/BasicEvents.h"
#include <windows.h>
#define NS_NUM_OF_KEYS 70

View File

@ -61,6 +61,7 @@ CPP_SOURCES += [
'nsWidgetFactory.cpp',
'nsWinGesture.cpp',
'nsWindow.cpp',
'nsWindowBase.cpp',
'nsWindowDbg.cpp',
'nsWindowGfx.cpp',
]

View File

@ -172,6 +172,8 @@
#include "mozilla/HangMonitor.h"
#include "WinIMEHandler.h"
#include "npapi.h"
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::layers;

View File

@ -0,0 +1,29 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsWindowBase.h"
#include "mozilla/MiscEvents.h"
#include "npapi.h"
using namespace mozilla;
bool
nsWindowBase::DispatchPluginEvent(const MSG& aMsg)
{
if (!PluginHasFocus()) {
return false;
}
WidgetPluginEvent pluginEvent(true, NS_PLUGIN_INPUT_EVENT, this);
nsIntPoint point(0, 0);
InitEvent(pluginEvent, &point);
NPEvent npEvent;
npEvent.event = aMsg.message;
npEvent.wParam = aMsg.wParam;
npEvent.lParam = aMsg.lParam;
pluginEvent.pluginEvent = &npEvent;
pluginEvent.retargetToFocusedDocument = true;
return DispatchWindowEvent(&pluginEvent);
}

View File

@ -6,9 +6,8 @@
#ifndef nsWindowBase_h_
#define nsWindowBase_h_
#include "mozilla/MiscEvents.h"
#include "mozilla/EventForwards.h"
#include "nsBaseWidget.h"
#include "npapi.h"
#include <windows.h>
/*
@ -59,22 +58,7 @@ public:
/*
* Default dispatch of a plugin event.
*/
virtual bool DispatchPluginEvent(const MSG &aMsg)
{
if (!PluginHasFocus()) {
return false;
}
mozilla::WidgetPluginEvent pluginEvent(true, NS_PLUGIN_INPUT_EVENT, this);
nsIntPoint point(0, 0);
InitEvent(pluginEvent, &point);
NPEvent npEvent;
npEvent.event = aMsg.message;
npEvent.wParam = aMsg.wParam;
npEvent.lParam = aMsg.lParam;
pluginEvent.pluginEvent = (void *)&npEvent;
pluginEvent.retargetToFocusedDocument = true;
return DispatchWindowEvent(&pluginEvent);
}
virtual bool DispatchPluginEvent(const MSG& aMsg);
/*
* Returns true if a plugin has focus on this widget. Otherwise, false.