Bug 563850 - Add scriptable interfaces for EnterModalState et al. r+sr=jst

This commit is contained in:
Justin Dolske 2010-07-01 14:53:00 -07:00
Родитель 0e03f80863
Коммит 4eef333b53
2 изменённых файлов: 39 добавлений и 1 удалений

Просмотреть файл

@ -1267,6 +1267,27 @@ nsDOMWindowUtils::GetVisitedDependentComputedStyle(
return rv;
}
NS_IMETHODIMP
nsDOMWindowUtils::EnterModalState()
{
mWindow->EnterModalState();
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::LeaveModalState()
{
mWindow->LeaveModalState();
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::IsInModalState(PRBool *retval)
{
*retval = mWindow->IsInModalState();
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetParent()
{

Просмотреть файл

@ -53,7 +53,7 @@ interface nsIDOMEvent;
interface nsITransferable;
interface nsIQueryContentEventResult;
[scriptable, uuid(0da97f1f-ad20-43e5-9793-61df63cc9c9a)]
[scriptable, uuid(a6dbdbc9-5564-4e52-820a-4056c698f699)]
interface nsIDOMWindowUtils : nsISupports {
/**
@ -674,4 +674,21 @@ interface nsIDOMWindowUtils : nsISupports {
* is no current inner window, throws NS_ERROR_NOT_AVAILABLE.
*/
readonly attribute unsigned long long currentInnerWindowID;
/**
* Put the window into a state where scripts are frozen and events
* suppressed, for use when the window has launched a modal prompt.
*/
void enterModalState();
/**
* Resume normal window state, where scripts can run and events are
* delivered.
*/
void leaveModalState();
/**
* Is the window is in a modal state? [See enterModalState()]
*/
boolean isInModalState();
};