This check-in fixes a long standing problem of not being able to use any
keyboard controls on the embedded browser. Next step is to re-activate
the keyboard listener features.
M webclient/src_moz/EmbedProgress.cpp
- call TopLevelFocusIn to make sure we get the input focus
M webclient/src_moz/NativeBrowserControl.cpp
M webclient/src_moz/NativeBrowserControl.h
- copy TopLevelFocus{In,Out}() from EmbedPrivate.
git-svn-id: svn://10.0.0.236/trunk@165083 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -45,6 +45,9 @@
|
||||
#include <nsIDOMWindowInternal.h>
|
||||
#include <nsIChromeEventHandler.h>
|
||||
|
||||
// for the focus hacking we need to do
|
||||
#include <nsIFocusController.h>
|
||||
|
||||
NativeBrowserControl::NativeBrowserControl(void)
|
||||
{
|
||||
parentHWnd = nsnull;
|
||||
@@ -258,6 +261,44 @@ NativeBrowserControl::Destroy(void)
|
||||
parentHWnd = nsnull;
|
||||
}
|
||||
|
||||
// handle focus in and focus out events
|
||||
void
|
||||
NativeBrowserControl::TopLevelFocusIn(void)
|
||||
{
|
||||
if (mIsDestroyed)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> piWin;
|
||||
GetPIDOMWindow(getter_AddRefs(piWin));
|
||||
|
||||
if (!piWin)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIFocusController> focusController;
|
||||
piWin->GetRootFocusController(getter_AddRefs(focusController));
|
||||
if (focusController)
|
||||
focusController->SetActive(PR_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
NativeBrowserControl::TopLevelFocusOut(void)
|
||||
{
|
||||
if (mIsDestroyed)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> piWin;
|
||||
GetPIDOMWindow(getter_AddRefs(piWin));
|
||||
|
||||
if (!piWin)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIFocusController> focusController;
|
||||
piWin->GetRootFocusController(getter_AddRefs(focusController));
|
||||
if (focusController)
|
||||
focusController->SetActive(PR_FALSE);
|
||||
}
|
||||
|
||||
|
||||
NativeWrapperFactory *NativeBrowserControl::GetWrapperFactory()
|
||||
{
|
||||
return wrapperFactory;
|
||||
|
||||
Reference in New Issue
Block a user