content/events/src/nsDOMBeforeUnloadEvent.h
author Ehsan Akhgari <ehsan@mozilla.com>
Thu, 18 Jul 2013 12:06:38 -0400
changeset 139098 d5390807c2ce07d7e23a647ef322c53394e633a9
parent 135818 c06217a1e3f32f8df97a6ca5ac015b68c0f08a77
child 149615 f7b6f1ec30ee0bc0b438a493289e7c71180d3cf5
permissions -rw-r--r--
Bug 895141 - Remove useless prlong.h inclusions from the tree; r=jcranmer

/* -*- Mode: C++; tab-width: 2; 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 nsDOMBeforeUnloadEvent_h__
#define nsDOMBeforeUnloadEvent_h__

#include "nsIDOMBeforeUnloadEvent.h"
#include "nsDOMEvent.h"
#include "mozilla/dom/BeforeUnloadEventBinding.h"

class nsDOMBeforeUnloadEvent : public nsDOMEvent,
                               public nsIDOMBeforeUnloadEvent
{
public:
  nsDOMBeforeUnloadEvent(mozilla::dom::EventTarget* aOwner,
                         nsPresContext* aPresContext, nsEvent* aEvent)
  : nsDOMEvent(aOwner, aPresContext, aEvent)
  {
  }

  virtual JSObject* WrapObject(JSContext* aCx,
                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
  {
    return mozilla::dom::BeforeUnloadEventBinding::Wrap(aCx, aScope, this);
  }

  NS_DECL_ISUPPORTS_INHERITED

  // Forward to nsDOMEvent
  NS_FORWARD_TO_NSDOMEVENT

  // nsIDOMBeforeUnloadEvent Interface
  NS_DECL_NSIDOMBEFOREUNLOADEVENT
protected:
  nsString mText;
};

#endif // nsDOMBeforeUnloadEvent_h__