embedding/components/windowwatcher/src/nsAutoWindowStateHelper.h
author Frank Yan <fyan@mozilla.com>
Wed, 16 Jan 2013 13:10:18 -0800
changeset 119068 64eb6292b965b3cd08ae4a982b2ee7648e2b87d0
parent 106227 80e4ab0d24bc64ceaa7693ab5def36faffde7a40
child 142245 72bc1aebb5d0e8e025ab8c57149949c167c3d823
permissions -rw-r--r--
Bug 611553 - Make DOMWillOpenModalDialog a chrome-only event. r=dolske r=smaug

/* -*- 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 __nsAutoWindowStateHelper_h
#define __nsAutoWindowStateHelper_h

#include "nsCOMPtr.h"

/**
 * Helper class for dealing with notifications around opening modal
 * windows.
 */

class nsIDOMWindow;

class nsAutoWindowStateHelper
{
public:
  nsAutoWindowStateHelper(nsIDOMWindow *aWindow);
  ~nsAutoWindowStateHelper();

  bool DefaultEnabled()
  {
    return mDefaultEnabled;
  }

protected:
  bool DispatchEventToChrome(const char *aEventName);

  nsIDOMWindow *mWindow;
  nsCOMPtr<nsIDOMWindow> mCallerWindow;
  bool mDefaultEnabled;
};


#endif