Bug 1236512 - Part 2: Add isFullyOccluded attribute to ChromeWindow; r=bz

Right now, only Mac (after 10.9) will possibly return true; other platforms always
return false.

MozReview-Commit-ID: 8evSf3qQY8i
This commit is contained in:
Edgar Chen 2017-05-26 18:14:06 +08:00
parent 273f4b0c7e
commit 47a9de7747
3 changed files with 13 additions and 0 deletions

View File

@ -14126,6 +14126,15 @@ nsGlobalWindow::WindowState()
return nsIDOMChromeWindow::STATE_NORMAL;
}
bool
nsGlobalWindow::IsFullyOccluded()
{
MOZ_ASSERT(IsInnerWindow());
nsCOMPtr<nsIWidget> widget = GetMainWidget();
return widget && widget->IsFullyOccluded();
}
NS_IMETHODIMP
nsGlobalChromeWindow::Maximize()
{

View File

@ -1282,6 +1282,7 @@ public:
// ChromeWindow bits. Do NOT call these unless your window is in
// fact an nsGlobalChromeWindow.
uint16_t WindowState();
bool IsFullyOccluded();
nsIBrowserDOMWindow* GetBrowserDOMWindowOuter();
nsIBrowserDOMWindow* GetBrowserDOMWindow(mozilla::ErrorResult& aError);
void SetBrowserDOMWindowOuter(nsIBrowserDOMWindow* aBrowserWindow);

View File

@ -407,6 +407,9 @@ interface ChromeWindow {
[Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
readonly attribute unsigned short windowState;
[Func="nsGlobalWindow::IsPrivilegedChromeWindow"]
readonly attribute boolean isFullyOccluded;
/**
* browserDOMWindow provides access to yet another layer of
* utility functions implemented by chrome script. It will be null