michael@0: This Source Code Form is subject to the terms of the Mozilla Public michael@0: License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: nsIObserver topics for profile changing. Profile changing happens in phases michael@0: in the order given below. An observer may register separately for each phase michael@0: of the process depending on its needs. michael@0: michael@0: "profile-change-teardown" michael@0: All async activity must be stopped in this phase. Typically, michael@0: the application level observer will close all open windows. michael@0: This is the last phase in which the subject's vetoChange() michael@0: method may still be called. michael@0: The next notification will be either michael@0: profile-change-teardown-veto or profile-before-change. michael@0: michael@0: "profile-before-change" michael@0: Called before the profile has changed. Use this notification michael@0: to prepare for the profile going away. If a component is michael@0: holding any state which needs to be flushed to a profile-relative michael@0: location, it should be done here. michael@0: michael@0: "profile-do-change" michael@0: Called after the profile has changed. Do the work to michael@0: respond to having a new profile. Any change which michael@0: affects others must be done in this phase. michael@0: michael@0: "profile-after-change" michael@0: Called after the profile has changed. Use this notification michael@0: to make changes that are dependent on what some other listener michael@0: did during its profile-do-change. For example, to respond to michael@0: new preferences. michael@0: michael@0: "profile-initial-state" michael@0: Called after all phases of a change have completed. Typically michael@0: in this phase, an application level observer will open a new window. michael@0: michael@0: Contexts for profile changes. These are passed as the someData param to the michael@0: observer's Observe() method. michael@0: michael@0: "startup" michael@0: Going from no profile to a profile. michael@0: The following topics happen in this context: michael@0: profile-do-change michael@0: profile-after-change michael@0: michael@0: "shutdown-persist" michael@0: The user is logging out and whatever data the observer stores michael@0: for the current profile should be released from memory and michael@0: saved to disk. michael@0: The following topics happen in this context: michael@0: profile-change-net-teardown michael@0: profile-change-teardown michael@0: profile-before-change michael@0: michael@0: See https://wiki.mozilla.org/XPCOM_Shutdown for more details about the shutdown michael@0: process. michael@0: michael@0: NOTE: Long ago there was be a "shutdown-cleanse" version of shutdown which was michael@0: intended to clear profile data. This is no longer sent and observer code should michael@0: remove support for it.