nsAutoWindowStateHelper.h 855 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef __nsAutoWindowStateHelper_h
  6. #define __nsAutoWindowStateHelper_h
  7. #include "nsCOMPtr.h"
  8. #include "nsPIDOMWindow.h"
  9. /**
  10. * Helper class for dealing with notifications around opening modal
  11. * windows.
  12. */
  13. class nsPIDOMWindowOuter;
  14. class nsAutoWindowStateHelper
  15. {
  16. public:
  17. explicit nsAutoWindowStateHelper(nsPIDOMWindowOuter* aWindow);
  18. ~nsAutoWindowStateHelper();
  19. bool DefaultEnabled() { return mDefaultEnabled; }
  20. protected:
  21. bool DispatchEventToChrome(const char* aEventName);
  22. nsCOMPtr<nsPIDOMWindowOuter> mWindow;
  23. bool mDefaultEnabled;
  24. };
  25. #endif