Bug 76617 - embedding app can't get input focus. r=sfraser.sr=blizzard@mozilla.org

This commit is contained in:
ccarlen%netscape.com 2001-05-04 21:06:16 +00:00
parent 8a45928d59
commit e67fea8f0f

View File

@ -48,6 +48,7 @@
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIDOMHTMLCollection.h" #include "nsIDOMHTMLCollection.h"
#include "nsIWebBrowserFind.h" #include "nsIWebBrowserFind.h"
#include "nsIWebBrowserFocus.h"
#include "nsWeakPtr.h" #include "nsWeakPtr.h"
#include <UModalDialogs.h> #include <UModalDialogs.h>
@ -253,10 +254,16 @@ void CBrowserShell::AdjustCursorSelf(Point /* inPortPt */,
void CBrowserShell::BeTarget() void CBrowserShell::BeTarget()
{ {
nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
if (focus)
focus->Activate();
} }
void CBrowserShell::DontBeTarget() void CBrowserShell::DontBeTarget()
{ {
nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
if (focus)
focus->Deactivate();
} }
Boolean CBrowserShell::HandleKeyPress(const EventRecord &inKeyEvent) Boolean CBrowserShell::HandleKeyPress(const EventRecord &inKeyEvent)