nsIWindowCreator2.idl 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. /**
  7. * nsIWindowCreator2 is an extension of nsIWindowCreator which allows
  8. * additional information about the context of the window creation to
  9. * be passed.
  10. *
  11. * @see nsIWindowCreator
  12. * @see nsIWindowWatcher
  13. *
  14. * @status
  15. */
  16. #include "nsIWindowCreator.idl"
  17. interface nsITabParent;
  18. interface nsIURI;
  19. interface nsIWebBrowserChrome;
  20. interface mozIDOMWindowProxy;
  21. [scriptable, uuid(b6c44689-f97e-4f32-a723-29eeddfbdc53)]
  22. interface nsIWindowCreator2 : nsIWindowCreator {
  23. /**
  24. * Definitions for contextFlags
  25. */
  26. // Likely that the window is an advertising popup.
  27. const unsigned long PARENT_IS_LOADING_OR_RUNNING_TIMEOUT = 0x00000001;
  28. /** Create a new window. Gecko will/may call this method, if made
  29. available to it, to create new windows.
  30. @param parent Parent window, if any. Null if not. The newly created
  31. window should be made a child/dependent window of
  32. the parent, if any (and if the concept applies
  33. to the underlying OS).
  34. @param chromeFlags Chrome features from nsIWebBrowserChrome
  35. @param contextFlags Flags about the context of the window being created.
  36. @param aOpeningTab The TabParent that is trying to open this new chrome
  37. window. Can be nullptr.
  38. @param aOpener The window which is trying to open this new chrome window.
  39. Can be nullptr
  40. @param cancel Return |true| to reject window creation. If true the
  41. implementation has determined the window should not
  42. be created at all. The caller should not default
  43. to any possible backup scheme for creating the window.
  44. @return the new window. Will be null if canceled or an error occurred.
  45. */
  46. nsIWebBrowserChrome createChromeWindow2(in nsIWebBrowserChrome parent,
  47. in uint32_t chromeFlags,
  48. in uint32_t contextFlags,
  49. in nsITabParent aOpeningTab,
  50. in mozIDOMWindowProxy aOpener,
  51. out boolean cancel);
  52. /**
  53. * B2G multi-screen support. When open another top-level window on b2g,
  54. * a screen ID is needed for identifying which screen this window is
  55. * opened to.
  56. * @param aScreenId Differentiate screens of windows. It is platform-
  57. * specific due to the hardware limitation for now.
  58. */
  59. [noscript]
  60. void setScreenId(in uint32_t aScreenId);
  61. };