Bug 528491, combine nsFocusController and nsWindowRoot, r=jst,sr=smaug

This commit is contained in:
Neil Deakin
2010-02-20 11:07:03 -05:00
parent 96b0a4b8d6
commit b646d240d2
22 changed files with 252 additions and 572 deletions

View File

@@ -160,6 +160,7 @@
#include "nsIEditingSession.h"
#include "nsPIDOMWindow.h"
#include "nsPIWindowRoot.h"
#include "nsIDOMDocument.h"
#include "nsICachingChannel.h"
#include "nsICacheVisitor.h"
@@ -179,7 +180,6 @@
#include "nsCExternalHandlerService.h"
#include "nsIExternalProtocolService.h"
#include "nsIFocusController.h"
#include "nsFocusManager.h"
#include "nsITextToSubURI.h"
@@ -10970,18 +10970,16 @@ nsDocShell::GetControllerForCommand(const char * inCommand,
{
NS_ENSURE_ARG_POINTER(outController);
*outController = nsnull;
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsPIDOMWindow> window ( do_QueryInterface(mScriptGlobal) );
if (window) {
nsIFocusController *focusController = window->GetRootFocusController();
if (focusController)
rv = focusController->GetControllerForCommand (window, inCommand, outController);
} // if window
return rv;
nsCOMPtr<nsPIDOMWindow> window(do_QueryInterface(mScriptGlobal));
if (window) {
nsCOMPtr<nsPIWindowRoot> root = window->GetTopWindowRoot();
if (root) {
return root->GetControllerForCommand(inCommand, outController);
}
}
return NS_ERROR_FAILURE;
}
nsresult