TOC PREV NEXT INDEX

Embedding Gecko API


nsIWebBrowserFocus


This interface allows embedders to control and interact with browser focus management. The embedded browser can be focused by clicking in it or tabbing into it. For the browser's focus memory to work correctly deactivate must be called if the browser is currently focused and the embedding application's top level window is disabled and activate must be called again when the top level window is reactivated. This interface is scriptable.

Methods
activate

Helps to manage focus memory. This call is MANDATORY and must be made to the browser when the embedding application's window is activated and the browser area was the last thing in focus. This method can also be called if the embedding application wishes to give the browser area focus without affecting the currently focused element within the browser.

Note: If you fail to make this call, Gecko focus memory will not work correctly.

Syntax:

void nsIWebBrowserFocus::activate()  

Parameters:

None.

nsresult :

NS_OK if successful.
deactivate

Helps to manage focus memory. This call is MANDATORY and must be made to the browser when the embedding application's window is deactivated and the browser area was the last thing in focus. On non-Windows platforms, it should also be called when focus moves from the browser to the embedding chrome.

Note: If you fail to make this call, Gecko focus memory will not work correctly.

Syntax:

void nsIWebBrowserFocus::deactivate()  

Parameters:

None.

nsresult :

NS_OK if successful.
setFocusAtFirstElement

Gives the first element within the browser focus: i.e. TAB was pressed and focus should enter the browser.

Syntax:

void nsIWebBrowserFocus::setFocusAtFirstElement()  

Parameters:

None.

nsresult :

NS_OK if successful.
setFocusAtLastElement

Gives the last element within the browser focus: i.e. SHIFT-TAB was pressed and focus should enter the browser.

Syntax:

void nsIWebBrowserFocus::setFocusAtFirstElement()  

Parameters:

None.

nsresult :

NS_OK if successful.
Attributes
attribute nsIDOMWindow nsIWebBrowserFocus::focusedWindow

Represents the currently focused nsDOMWindow when the browser is active, or the last focused nsDOMWindow when the browser is inactive.

attribute nsIDOMElement nsIWebBrowserFocus::focusedElement

Represents the currently focused nsDOMElement when the browser is active, or the last focused nsDOMElement when the browser is inactive.


Written by:Ellen Evans | Comments, questions, complaints? Bug 143387
TOC PREV NEXT INDEX