Bug 568348 - The extension manager should do extension install activities and write extensions.ini before the profile is started. r=Mossop

This commit is contained in:
Benedict Hsieh 2010-06-11 12:02:44 -07:00
parent 36ada5a7cb
commit c692b59718
3 changed files with 7 additions and 4 deletions

View File

@ -71,7 +71,7 @@ amManager.prototype = {
getService(Ci.nsIObserverService);
switch (aTopic) {
case "profile-after-change":
case "addons-startup":
os.addObserver(this, "xpcom-shutdown", false);
AddonManagerPrivate.startup();
break;
@ -170,8 +170,7 @@ amManager.prototype = {
classDescription: "Addons Manager",
contractID: "@mozilla.org/addons/integration;1",
classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
_xpcom_categories: [{ category: "profile-after-change" },
{ category: "update-timer",
_xpcom_categories: [{ category: "update-timer",
value: "@mozilla.org/addons/integration;1," +
"getService,addon-background-update-timer," +
PREF_EM_UPDATE_INTERVAL + ",86400" }],

View File

@ -144,7 +144,7 @@ function startupManager(aExpectedRestarts, aAppChanged) {
getService(AM_Ci.nsIObserver).
QueryInterface(AM_Ci.nsITimerCallback);
gInternalManager.observe(null, "profile-after-change", "startup");
gInternalManager.observe(null, "addons-startup", null);
let appStartup = AM_Cc["@mozilla.org/toolkit/app-startup;1"].
getService(AM_Ci.nsIAppStartup2);

View File

@ -47,6 +47,7 @@
#include "nsIJSContextStack.h"
#include "nsIDirectoryEnumerator.h"
#include "nsILocalFile.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsIProfileChangeStatus.h"
#include "nsISimpleEnumerator.h"
@ -816,6 +817,9 @@ nsXREDirProvider::DoStartup()
static const PRUnichar kStartup[] = {'s','t','a','r','t','u','p','\0'};
obsSvc->NotifyObservers(nsnull, "profile-do-change", kStartup);
// Init the Extension Manager
nsCOMPtr<nsIObserver> em = do_GetService("@mozilla.org/addons/integration;1");
em->Observe(nsnull, "addons-startup", nsnull);
obsSvc->NotifyObservers(nsnull, "profile-after-change", kStartup);
// Any component that has registered for the profile-after-change category