Camino only - Bug 394105: Get our string bundle override into nsStringBundleService as soon as possible. sr=pink

git-svn-id: svn://10.0.0.236/branches/CAMINO_2_0_BRANCH@258384 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
stuart.morgan%alumni.case.edu
2009-09-15 00:36:10 +00:00
parent 6f8b6edb5d
commit 1fe8d89bac

View File

@@ -94,6 +94,7 @@
#include "nsICookieManager.h"
#include "nsIBrowserHistory.h"
#include "nsICacheService.h"
#include "nsIStringBundle.h"
extern const nsModuleComponentInfo* GetAppComponents(unsigned int* outNumComponents);
@@ -199,6 +200,17 @@ const int kZoomActionsTag = 108;
const nsModuleComponentInfo* comps = GetAppComponents(&numComps);
CHBrowserService::RegisterAppComponents(comps, numComps);
// This is a hack to make sure that the string bundle service knows about our
// override as soon as possible, since some core components cache their string
// bundle instance when they are inited, and will bypass us if we aren't in
// place.
nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID));
nsCOMPtr<nsIObserver> bundleServiceAsObserver = do_QueryInterface(bundleService);
if (bundleServiceAsObserver) {
bundleServiceAsObserver->Observe(NULL, "xpcom-category-entry-added",
NS_LITERAL_STRING("xpcom-autoregistration").get());
}
// add our OpenSearch handler
AddSearchProviderHandler::InstallHandler();