From 6718a9341da996d67504b93822cf9121115d23bb Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 29 Oct 2013 13:14:42 +0900 Subject: [PATCH] Bug 930855 Replace WidgetEvent::Is*EventDerivedClass() with WidgetEvent::As*Event() r=smaug --- content/events/src/nsEventStateManager.cpp | 2 +- widget/BasicEvents.h | 8 -------- widget/shared/WidgetEventImpl.cpp | 12 ------------ widget/windows/winrt/MetroWidget.cpp | 2 +- 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index cf528420152..1534ab3894e 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -135,7 +135,7 @@ RoundDown(double aDouble) static inline bool IsMouseEventReal(WidgetEvent* aEvent) { - NS_ABORT_IF_FALSE(aEvent->IsMouseDerivedEvent(), "Not a mouse event"); + NS_ABORT_IF_FALSE(aEvent->AsMouseEvent(), "Not a mouse event"); // Return true if not synthesized. return aEvent->AsMouseEvent()->reason == WidgetMouseEvent::eReal; } diff --git a/widget/BasicEvents.h b/widget/BasicEvents.h index 03ac4d873a0..6a56a3f8546 100644 --- a/widget/BasicEvents.h +++ b/widget/BasicEvents.h @@ -690,14 +690,6 @@ public: #undef NS_EVENT_CLASS #undef NS_ROOT_EVENT_CLASS - /** - * Returns true if the event is WidgetInputEvent or inherits it. - */ - bool IsInputDerivedEvent() const; - /** - * Returns true if the event is WidgetMouseEvent or inherits it. - */ - bool IsMouseDerivedEvent() const; /** * Returns true if the event is a query content event. */ diff --git a/widget/shared/WidgetEventImpl.cpp b/widget/shared/WidgetEventImpl.cpp index 39b7d8acfb5..b80d3b2d120 100644 --- a/widget/shared/WidgetEventImpl.cpp +++ b/widget/shared/WidgetEventImpl.cpp @@ -42,18 +42,6 @@ WidgetEvent::As##aName() const \ * Event struct type checking methods. ******************************************************************************/ -bool -WidgetEvent::IsInputDerivedEvent() const -{ - return AsInputEvent() != nullptr; -} - -bool -WidgetEvent::IsMouseDerivedEvent() const -{ - return AsMouseEvent() != nullptr; -} - bool WidgetEvent::IsQueryContentEvent() const { diff --git a/widget/windows/winrt/MetroWidget.cpp b/widget/windows/winrt/MetroWidget.cpp index 8ba3009e5a6..7194b3aefab 100644 --- a/widget/windows/winrt/MetroWidget.cpp +++ b/widget/windows/winrt/MetroWidget.cpp @@ -1209,7 +1209,7 @@ MetroWidget::DispatchWindowEvent(WidgetGUIEvent* aEvent) NS_IMETHODIMP MetroWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus & aStatus) { - if (event->IsInputDerivedEvent()) { + if (event->AsInputEvent()) { UserActivity(); }