2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsDOMBeforeUnloadEvent.h"
|
|
|
|
|
2013-10-01 20:46:04 -07:00
|
|
|
using namespace mozilla;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMPL_ADDREF_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
|
|
|
|
NS_IMPL_RELEASE_INHERITED(nsDOMBeforeUnloadEvent, nsDOMEvent)
|
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsDOMBeforeUnloadEvent)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIDOMBeforeUnloadEvent)
|
|
|
|
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMBeforeUnloadEvent::SetReturnValue(const nsAString& aReturnValue)
|
|
|
|
{
|
2009-06-24 01:42:00 -07:00
|
|
|
mText = aReturnValue;
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_OK; // Don't throw an exception
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMBeforeUnloadEvent::GetReturnValue(nsAString& aReturnValue)
|
|
|
|
{
|
2009-06-24 01:42:00 -07:00
|
|
|
aReturnValue = mText;
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_OK; // Don't throw an exception
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult NS_NewDOMBeforeUnloadEvent(nsIDOMEvent** aInstancePtrResult,
|
2013-03-09 03:34:29 -08:00
|
|
|
mozilla::dom::EventTarget* aOwner,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsPresContext* aPresContext,
|
2013-10-01 20:46:04 -07:00
|
|
|
WidgetEvent* aEvent)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
nsDOMBeforeUnloadEvent* it =
|
2013-03-09 03:34:29 -08:00
|
|
|
new nsDOMBeforeUnloadEvent(aOwner, aPresContext, aEvent);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
return CallQueryInterface(it, aInstancePtrResult);
|
|
|
|
}
|