dom/browser-element/nsOpenWindowEventDetail.h
author Steven Lee <slee@mozilla.com>
Sun, 23 Sep 2012 13:00:32 -0400
changeset 114720 4a8ade9e7af866d1a289cf506e44822ffeb1fb6c
parent 101817 65a425a98e860afa7132473dbf6a2f6868374b92
permissions -rw-r--r--
Bug 792443 - hal::RegisterSystemTimeChangeObserver should register the observer through sandbox, r=jlebar

/* 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 "nsIOpenWindowEventDetail.h"
#include "nsIDOMNode.h"
#include "nsCycleCollectionParticipant.h"
#include "nsCOMPtr.h"
#include "nsString.h"

/**
 * When we send a mozbrowseropenwindow event (an instance of CustomEvent), we
 * use an instance of this class as the event's detail.
 */
class nsOpenWindowEventDetail : public nsIOpenWindowEventDetail
{
public:
  nsOpenWindowEventDetail(const nsAString& aURL,
                          const nsAString& aName,
                          const nsAString& aFeatures,
                          nsIDOMNode* aFrameElement)
    : mURL(aURL)
    , mName(aName)
    , mFeatures(aFeatures)
    , mFrameElement(aFrameElement)
  {}

  virtual ~nsOpenWindowEventDetail() {}

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_CLASS(nsOpenWindowEventDetail)
  NS_DECL_NSIOPENWINDOWEVENTDETAIL

private:
  const nsString mURL;
  const nsString mName;
  const nsString mFeatures;
  nsCOMPtr<nsIDOMNode> mFrameElement;
};