Force the window datasource to be initialized at app startup so that it recognizes all windows. Bug 169378. Patch by neil@parkwaycc.co.uk, r+sr=me.

git-svn-id: svn://10.0.0.236/trunk@169759 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2005-02-24 06:52:50 +00:00
parent bd47b00351
commit 5ec1a53838
2 changed files with 34 additions and 2 deletions

View File

@@ -151,6 +151,22 @@ UnregisterProc(nsIComponentManager *aCompMgr,
"application/http-index-format", PR_TRUE);
}
static NS_METHOD
RegisterWindowDS(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
{
nsresult rv;
nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
return catman->AddCategoryEntry("app-startup", "Window Data Source",
"service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
PR_TRUE, PR_TRUE, nsnull);
}
static const nsModuleComponentInfo components[] = {
{ "Directory Viewer", NS_DIRECTORYVIEWERFACTORY_CID,
"@mozilla.org/xpfe/http-index-format-factory-constructor",
@@ -218,7 +234,7 @@ static const nsModuleComponentInfo components[] = {
{ "nsWindowDataSource",
NS_WINDOWDATASOURCE_CID,
NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
nsWindowDataSourceConstructor },
nsWindowDataSourceConstructor, RegisterWindowDS },
#if defined(XP_WIN)
#if !defined(MOZ_PHOENIX) && !defined(MOZ_XULRUNNER)
{ NS_IURLWIDGET_CLASSNAME, NS_IURLWIDGET_CID, NS_IURLWIDGET_CONTRACTID,

View File

@@ -79,6 +79,22 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsHooks)
#endif // Windows
static NS_METHOD
RegisterWindowDS(nsIComponentManager *aCompMgr,
nsIFile *aPath,
const char *registryLocation,
const char *componentType,
const nsModuleComponentInfo *info)
{
nsresult rv;
nsCOMPtr<nsICategoryManager> catman = do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
return catman->AddCategoryEntry("app-startup", "Window Data Source",
"service," NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
PR_TRUE, PR_TRUE, nsnull);
}
static const nsModuleComponentInfo components[] = {
{ "Download Manager", NS_DOWNLOADMANAGER_CID, NS_DOWNLOADMANAGER_CONTRACTID,
@@ -110,7 +126,7 @@ static const nsModuleComponentInfo components[] = {
{ "nsWindowDataSource",
NS_WINDOWDATASOURCE_CID,
NS_RDF_DATASOURCE_CONTRACTID_PREFIX "window-mediator",
nsWindowDataSourceConstructor },
nsWindowDataSourceConstructor, RegisterWindowDS },
};
NS_IMPL_NSGETMODULE(application, components)