Bug 602787 part.8 Don't implement nsWindowBase::DispatchPluginEvent() in windows/nsWindowBase.h r=jimm
☠☠ backed out by 3c5efc154d58 ☠ ☠
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 22 Oct 2013 22:27:35 +0900
changeset 165508 57ca2861ea307d39f596cd3e06d4f168c028119f
parent 165507 3b9f1062d915eac40ae1d14dd56d7f262e60ab65
child 165509 70606b9b1e4200eff4239bb224f64d38d1cf8cd7
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs602787
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 602787 part.8 Don't implement nsWindowBase::DispatchPluginEvent() in windows/nsWindowBase.h r=jimm
widget/windows/KeyboardLayout.h
widget/windows/moz.build
widget/windows/nsWindow.cpp
widget/windows/nsWindowBase.cpp
widget/windows/nsWindowBase.h
--- a/widget/windows/KeyboardLayout.h
+++ b/widget/windows/KeyboardLayout.h
@@ -6,17 +6,17 @@
 #ifndef KeyboardLayout_h__
 #define KeyboardLayout_h__
 
 #include "nscore.h"
 #include "nsAutoPtr.h"
 #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
 
 #define VK_OEM_1                0xBA   // ';:' for US
 #define VK_OEM_PLUS             0xBB   // '+' any country
 #define VK_OEM_COMMA            0xBC
 #define VK_OEM_MINUS            0xBD   // '-' any country
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -56,16 +56,17 @@ CPP_SOURCES += [
     'nsScreenManagerWin.cpp',
     'nsScreenWin.cpp',
     'nsSound.cpp',
     'nsToolkit.cpp',
     'nsUXThemeData.cpp',
     'nsWidgetFactory.cpp',
     'nsWinGesture.cpp',
     'nsWindow.cpp',
+    'nsWindowBase.cpp',
     'nsWindowDbg.cpp',
     'nsWindowGfx.cpp',
 ]
 
 if CONFIG['MOZ_CRASHREPORTER']:
     CPP_SOURCES += [
         'LSPAnnotator.cpp',
     ]
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -167,16 +167,18 @@
 #include "nsCrashOnException.h"
 #include "nsIXULRuntime.h"
 
 #include "nsIContent.h"
 
 #include "mozilla/HangMonitor.h"
 #include "WinIMEHandler.h"
 
+#include "npapi.h"
+
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 using namespace mozilla::widget;
 
 /**************************************************************
  **************************************************************
  **
new file mode 100644
--- /dev/null
+++ b/widget/windows/nsWindowBase.cpp
@@ -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);
+}
--- a/widget/windows/nsWindowBase.h
+++ b/widget/windows/nsWindowBase.h
@@ -1,19 +1,18 @@
 /* -*- 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/. */
 
 #ifndef nsWindowBase_h_
 #define nsWindowBase_h_
 
-#include "mozilla/MiscEvents.h"
+#include "mozilla/EventForwards.h"
 #include "nsBaseWidget.h"
-#include "npapi.h"
 #include <windows.h>
 
 /*
  * nsWindowBase - Base class of common methods other classes need to access
  * in both win32 and winrt window classes.
  */
 class nsWindowBase : public nsBaseWidget
 {
@@ -54,32 +53,17 @@ public:
    * is called by KeyboardLayout to dispatch gecko events.
    * Returns true if it's consumed.  Otherwise, false.
    */
   virtual bool DispatchKeyboardEvent(mozilla::WidgetGUIEvent* aEvent) = 0;
 
   /*
    * 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.
    */
   virtual bool PluginHasFocus() const MOZ_FINAL
   {
     return (mInputContext.mIMEState.mEnabled == IMEState::PLUGIN);
   }