diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 8ec97e1176b..4c4a6c56dfd 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -194,6 +194,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); NS_IMETHOD NewWebShell(nsIWebShell *&aNewWebShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); + NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell); // nsILinkHandler NS_IMETHOD OnLinkClick(nsIFrame* aFrame, @@ -1410,6 +1411,12 @@ nsWebShell::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) return NS_OK; } +NS_IMETHODIMP +nsWebShell::FocusAvailable(nsIWebShell* aFocusedWebShell) +{ + //XXX Move focus to next child, or if on last child, call focus available on next container + return NS_OK; +} //---------------------------------------------------------------------- // WebShell link handling diff --git a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp b/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp index 0a862f08bff..beb9b1c74c8 100644 --- a/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp +++ b/mozilla/webshell/embed/ActiveX/WebShellContainer.cpp @@ -160,6 +160,11 @@ CWebShellContainer::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& a return NS_ERROR_FAILURE; } +NS_IMETHODIMP +CWebShellContainer::FocusAvailable(nsIWebShell* aFocusedWebShell) +{ + return NS_OK; +} /////////////////////////////////////////////////////////////////////////////// // nsIStreamObserver implementation diff --git a/mozilla/webshell/embed/ActiveX/WebShellContainer.h b/mozilla/webshell/embed/ActiveX/WebShellContainer.h index 92ee7728bdf..d1fbe33468b 100644 --- a/mozilla/webshell/embed/ActiveX/WebShellContainer.h +++ b/mozilla/webshell/embed/ActiveX/WebShellContainer.h @@ -33,6 +33,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); NS_IMETHOD NewWebShell(nsIWebShell *&aNewWebShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); + NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell); // nsIStreamObserver NS_IMETHOD OnStartBinding(nsIURL* aURL, const char *aContentType); diff --git a/mozilla/webshell/public/nsIWebShell.h b/mozilla/webshell/public/nsIWebShell.h index 1e064900a56..e9d799f08fa 100644 --- a/mozilla/webshell/public/nsIWebShell.h +++ b/mozilla/webshell/public/nsIWebShell.h @@ -70,6 +70,15 @@ public: NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) = 0; + + /** + * Notify the WebShellContainer that a contained webshell is offering focus (for + * example if it finshed tabbing through its contents). The container can choose + * to set focus to themselves or ignore the message and let the contained keep + * focus + */ + NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell) = 0; + // NS_IMETHOD SetHistoryIndex(PRInt32 aIndex, PRInt32 aMaxIndex) = 0; // Link traversing control diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 8ec97e1176b..4c4a6c56dfd 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -194,6 +194,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); NS_IMETHOD NewWebShell(nsIWebShell *&aNewWebShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); + NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell); // nsILinkHandler NS_IMETHOD OnLinkClick(nsIFrame* aFrame, @@ -1410,6 +1411,12 @@ nsWebShell::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult) return NS_OK; } +NS_IMETHODIMP +nsWebShell::FocusAvailable(nsIWebShell* aFocusedWebShell) +{ + //XXX Move focus to next child, or if on last child, call focus available on next container + return NS_OK; +} //---------------------------------------------------------------------- // WebShell link handling diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 00ec4babc23..6d3201f2745 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -1483,6 +1483,12 @@ nsBrowserWindow::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aRes return NS_OK; } +NS_IMETHODIMP +nsBrowserWindow::FocusAvailable(nsIWebShell* aFocusedWebShell) +{ + return NS_OK; +} + //---------------------------------------- // Stream observer implementation diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.h b/mozilla/webshell/tests/viewer/nsBrowserWindow.h index cba35b66418..2cfe88ad060 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.h +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.h @@ -97,6 +97,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); NS_IMETHOD NewWebShell(nsIWebShell *&aNewWebShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); + NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell); // nsINetSupport NS_IMETHOD_(void) Alert(const nsString &aText); diff --git a/mozilla/xpfe/xpviewer/src/nsBrowserWindow.cpp b/mozilla/xpfe/xpviewer/src/nsBrowserWindow.cpp index 09383db4cc4..ebbff2d31ee 100644 --- a/mozilla/xpfe/xpviewer/src/nsBrowserWindow.cpp +++ b/mozilla/xpfe/xpviewer/src/nsBrowserWindow.cpp @@ -2400,6 +2400,11 @@ nsBrowserWindow::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aRes return NS_OK; } +NS_IMETHODIMP +nsBrowserWindow::FocusAvailable(nsIWebShell* aFocusedWebShell) +{ + return NS_OK; +} //---------------------------------------- diff --git a/mozilla/xpfe/xpviewer/src/nsBrowserWindow.h b/mozilla/xpfe/xpviewer/src/nsBrowserWindow.h index d21b72771cc..2253d055378 100644 --- a/mozilla/xpfe/xpviewer/src/nsBrowserWindow.h +++ b/mozilla/xpfe/xpviewer/src/nsBrowserWindow.h @@ -110,6 +110,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); NS_IMETHOD NewWebShell(nsIWebShell *&aNewWebShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); + NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell); // nsINetSupport NS_IMETHOD_(void) Alert(const nsString &aText); diff --git a/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.cpp b/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.cpp index 649087db703..8b1a9f11929 100644 --- a/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.cpp +++ b/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.cpp @@ -454,6 +454,11 @@ NS_IMETHODIMP nsXPBaseWindow::FindWebShellWithName(const PRUnichar* aName, nsIWe return NS_OK; } +NS_IMETHODIMP nsXPBaseWindow::FocusAvailable(nsIWebShell* aFocusedWebShell) +{ + return NS_OK; +} + //----------------------------------------------------------------- NS_IMETHODIMP nsXPBaseWindow::AddEventListener(nsIDOMNode * aNode) { diff --git a/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.h b/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.h index eca5febacd8..7e9c06a42de 100644 --- a/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.h +++ b/mozilla/xpfe/xpviewer/src/nsXPBaseWindow.h @@ -100,6 +100,7 @@ public: NS_IMETHOD EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aStatus); NS_IMETHOD NewWebShell(nsIWebShell *&aNewWebShell); NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult); + NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell); // nsINetSupport NS_IMETHOD_(void) Alert(const nsString &aText);