From b1993962adcf5535b3bdfdc871c36fd44dfbb4a8 Mon Sep 17 00:00:00 2001 From: "danm%netscape.com" Date: Thu, 6 Dec 2001 22:35:02 +0000 Subject: [PATCH] adding a blur method (0.9.4 branch). bug 57841 r=hyatt,rpotts a=valeski git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@109882 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 10 ++++++++++ mozilla/docshell/base/nsIDocShell.idl | 6 ++++++ .../browser/webBrowser/nsIEmbeddingSiteWindow.idl | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 647e666dd50..4bbff9ee07e 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -1406,6 +1406,16 @@ nsDocShell::TabToTreeOwner(PRBool aForward, PRBool* aTookFocus) return NS_OK; } +NS_IMETHODIMP +nsDocShell::Blur() +{ + nsCOMPtr window = do_GetInterface(mTreeOwner); + if (window) + return window->Blur(); + + return NS_ERROR_FAILURE; +} + //***************************************************************************** // nsDocShell::nsIDocShellTreeItem diff --git a/mozilla/docshell/base/nsIDocShell.idl b/mozilla/docshell/base/nsIDocShell.idl index 3871fe4fcc7..2e5bd4ed142 100644 --- a/mozilla/docshell/base/nsIDocShell.idl +++ b/mozilla/docshell/base/nsIDocShell.idl @@ -263,6 +263,12 @@ interface nsIDocShell : nsISupports void tabToTreeOwner(in boolean forward, out boolean tookFocus); + /** + Tells the docshell to unfocus itself. This is the where nsIDOMWindow::blur + comes for its implementation. + */ + void blur(); + /** * Current busy state for DocShell */ diff --git a/mozilla/embedding/browser/webBrowser/nsIEmbeddingSiteWindow.idl b/mozilla/embedding/browser/webBrowser/nsIEmbeddingSiteWindow.idl index de3c2ed20a0..b14dbbffab1 100644 --- a/mozilla/embedding/browser/webBrowser/nsIEmbeddingSiteWindow.idl +++ b/mozilla/embedding/browser/webBrowser/nsIEmbeddingSiteWindow.idl @@ -87,6 +87,11 @@ interface nsIEmbeddingSiteWindow : nsISupports */ void setFocus(); + /** + * Blur the window + */ + void blur(); + /** * Visibility of the window. */