34 #include <nsIDOMWindow.h>
35 #include <nsPIDOMWindow.h>
36 #include <nsIDocShell.h>
37 #include <nsIDocShellTreeItem.h>
38 #include <nsIDocShellTreeOwner.h>
39 #include <nsIEmbeddingSiteWindow.h>
41 #include <nsIInterfaceRequestorUtils.h>
56 NS_ENSURE_ARG_POINTER(aDOMWindow);
57 return SetVisibility(aDOMWindow, PR_FALSE);
63 NS_ENSURE_ARG_POINTER(aDOMWindow);
71 NS_ENSURE_ARG_POINTER(aDOMWindow);
80 nsCOMPtr<nsPIDOMWindow> pWindow =
81 do_QueryInterface(aDOMWindow, &rv);
82 NS_ENSURE_SUCCESS(rv, rv);
84 nsIDocShell*
docShell = pWindow->GetDocShell();
85 NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
87 nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(docShell, &rv);
88 NS_ENSURE_SUCCESS(rv, rv);
90 nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
91 rv = treeItem->GetTreeOwner(getter_AddRefs(treeOwner));
92 NS_ENSURE_SUCCESS(rv, rv);
94 nsCOMPtr<nsIEmbeddingSiteWindow> embedWindow =
95 do_GetInterface(treeOwner, &rv);
96 NS_ENSURE_SUCCESS(rv, rv);
101 *_retval = cloakInfo && !cloakInfo->
mVisible ? PR_TRUE : PR_FALSE;
117 nsCOMPtr<nsPIDOMWindow> pWindow =
118 do_QueryInterface(aDOMWindow, &rv);
119 NS_ENSURE_SUCCESS(rv, rv);
121 nsIDocShell* docShell = pWindow->GetDocShell();
122 NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
124 nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(docShell, &rv);
125 NS_ENSURE_SUCCESS(rv, rv);
127 nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
128 rv = treeItem->GetTreeOwner(getter_AddRefs(treeOwner));
129 NS_ENSURE_SUCCESS(rv, rv);
131 nsCOMPtr<nsIEmbeddingSiteWindow> embedWindow =
132 do_GetInterface(treeOwner, &rv);
133 NS_ENSURE_SUCCESS(rv, rv);
147 NS_ENSURE_TRUE(cloakInfo, NS_ERROR_OUT_OF_MEMORY);
152 return NS_ERROR_FAILURE;
158 rv = embedWindow->SetVisibility(aVisible);
159 NS_ENSURE_SUCCESS(rv, rv);
NS_IMETHOD SetVisibility(nsIDOMWindow *aDOMWindow, PRBool aVisible)
NS_IMPL_ISUPPORTS1(sbDeviceCapabilitiesUtils, sbIDeviceCapabilitiesUtils) sbDeviceCapabilitiesUtils
nsClassHashtable< nsISupportsHashKey, sbCloakInfo > mCloakedWindows
NS_DECL_ISUPPORTS NS_DECL_SBIWINDOWCLOAK ~sbWindowCloak()
Window cloaking service interface This is an interface to the window cloaking service, used to hide a xul window without closing it, and to unhide it at a later time.
Songbird Window Cloaker Object Definition.