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.

This commit is contained in:
bryner%brianryner.com 2005-02-24 06:52:50 +00:00
Родитель f5dee5050c
Коммит bb2fdb1127
2 изменённых файлов: 34 добавлений и 2 удалений

Просмотреть файл

@ -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,

Просмотреть файл

@ -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)