From 1fe8d89bac8b93b7a08d4438a1b8e7681f33a864 Mon Sep 17 00:00:00 2001 From: "stuart.morgan%alumni.case.edu" Date: Tue, 15 Sep 2009 00:36:10 +0000 Subject: [PATCH] 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 --- mozilla/camino/src/application/MainController.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mozilla/camino/src/application/MainController.mm b/mozilla/camino/src/application/MainController.mm index a3e2d20c420..8652c3d06cb 100644 --- a/mozilla/camino/src/application/MainController.mm +++ b/mozilla/camino/src/application/MainController.mm @@ -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 bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID)); + nsCOMPtr 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();