diff options
Diffstat (limited to 'toolkit/components/windowwatcher')
-rw-r--r-- | toolkit/components/windowwatcher/nsIOpenWindowInfo.idl | 6 | ||||
-rw-r--r-- | toolkit/components/windowwatcher/nsOpenWindowInfo.cpp | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl b/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl index a8347c5a1a..c0edb18536 100644 --- a/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl +++ b/toolkit/components/windowwatcher/nsIOpenWindowInfo.idl @@ -74,4 +74,10 @@ interface nsIOpenWindowInfo : nsISupports { /* Callback to invoke when the browsing context for a new window is ready. */ [notxpcom, nostdcall] nsIBrowsingContextReadyCallback browsingContextReadyCallback(); + + /** + * When creating a window fails, we will be called to notify an error via + * callback. If no callback, do nothing. + */ + void cancel(); }; diff --git a/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp b/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp index 4374090075..042ee45f4e 100644 --- a/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp +++ b/toolkit/components/windowwatcher/nsOpenWindowInfo.cpp @@ -57,6 +57,14 @@ nsOpenWindowInfo::BrowsingContextReadyCallback() { return mBrowsingContextReadyCallback; } +NS_IMETHODIMP nsOpenWindowInfo::Cancel() { + if (mBrowsingContextReadyCallback) { + mBrowsingContextReadyCallback->BrowsingContextReady(nullptr); + mBrowsingContextReadyCallback = nullptr; + } + return NS_OK; +} + NS_IMPL_ISUPPORTS(nsBrowsingContextReadyCallback, nsIBrowsingContextReadyCallback) |