Bug 930855 Replace WidgetEvent::Is*EventDerivedClass() with WidgetEvent::As*Event() r=smaug

This commit is contained in:
Masayuki Nakano 2013-10-29 13:14:42 +09:00
parent baf9365819
commit 6718a9341d
4 changed files with 2 additions and 22 deletions

View File

@ -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;
}

View File

@ -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.
*/

View File

@ -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
{

View File

@ -1209,7 +1209,7 @@ MetroWidget::DispatchWindowEvent(WidgetGUIEvent* aEvent)
NS_IMETHODIMP
MetroWidget::DispatchEvent(WidgetGUIEvent* event, nsEventStatus & aStatus)
{
if (event->IsInputDerivedEvent()) {
if (event->AsInputEvent()) {
UserActivity();
}