Fix for #131175 - Chnages to register MRE components
r=dougt, sr=rpotts, a=drivers
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "nsIStringBundle.h"
|
||||
|
||||
#include "nsIDirectoryService.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
|
||||
#include "nsEmbedAPI.h"
|
||||
#include "nsLiteralString.h"
|
||||
@@ -108,6 +109,31 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory,
|
||||
return rv;
|
||||
}
|
||||
|
||||
// If the application is using an MRE, then,
|
||||
// auto register components in the MRE directory as well.
|
||||
//
|
||||
// The application indicates that it's using an MRE by
|
||||
// returning a valid nsIFile when queried (via appFileLocProvider)
|
||||
// for the NS_MRE_DIR atom as shown below
|
||||
//
|
||||
if (appFileLocProvider)
|
||||
{
|
||||
nsCOMPtr<nsIFile> mreDir;
|
||||
PRBool persistent = PR_TRUE;
|
||||
|
||||
appFileLocProvider->GetFile(NS_MRE_DIR, &persistent, getter_AddRefs(mreDir));
|
||||
|
||||
if (mreDir)
|
||||
{
|
||||
rv = registrar->AutoRegister(mreDir);
|
||||
if (NS_FAILED(rv))
|
||||
{
|
||||
NS_ASSERTION(PR_FALSE, "Could not AutoRegister MRE components");
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sRegistryInitializedFlag = PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user