michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __nsAutoWindowStateHelper_h michael@0: #define __nsAutoWindowStateHelper_h michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsPIDOMWindow.h" michael@0: michael@0: /** michael@0: * Helper class for dealing with notifications around opening modal michael@0: * windows. michael@0: */ michael@0: michael@0: class nsPIDOMWindow; michael@0: michael@0: class nsAutoWindowStateHelper michael@0: { michael@0: public: michael@0: nsAutoWindowStateHelper(nsPIDOMWindow *aWindow); michael@0: ~nsAutoWindowStateHelper(); michael@0: michael@0: bool DefaultEnabled() michael@0: { michael@0: return mDefaultEnabled; michael@0: } michael@0: michael@0: protected: michael@0: bool DispatchEventToChrome(const char *aEventName); michael@0: michael@0: nsCOMPtr mWindow; michael@0: bool mDefaultEnabled; michael@0: }; michael@0: michael@0: michael@0: #endif