const char *aTopic, const PRUnichar *aData)
const PRUnichar *aTopic, const PRUnichar *)
NS_IMETHODIMP nsAppShellService::Observe(nsISupports *aSubject,                                         const char *aTopic,                                         const PRUnichar *aData){  NS_ASSERTION(mAppShell, "appshell service notified before appshell built");  if (!strcmp(aTopic, gEQActivatedNotification)) {    nsCOMPtr<nsIEventQueue> eq(do_QueryInterface(aSubject));    if (eq) {      PRBool isNative = PR_TRUE;      // we only add native event queues to the appshell      eq->IsQueueNative(&isNative);      if (isNative)        mAppShell->ListenToEventQueue(eq, PR_TRUE);    }  } else if (!strcmp(aTopic, gEQDestroyedNotification)) {    nsCOMPtr<nsIEventQueue> eq(do_QueryInterface(aSubject));    if (eq) {      PRBool isNative = PR_TRUE;      // we only remove native event queues from the appshell      eq->IsQueueNative(&isNative);      if (isNative)        mAppShell->ListenToEventQueue(eq, PR_FALSE);    }  } else if (!strcmp(aTopic, gSkinSelectedTopic) ||             !strcmp(aTopic, gLocaleSelectedTopic) ||             !strcmp(aTopic, gInstallRestartTopic)) {    if (mNativeAppSupport)      mNativeAppSupport->SetIsServerMode(PR_FALSE);  } else if (!strcmp(aTopic, gProfileChangeTeardownTopic)) {    nsresult rv;    EnterLastWindowClosingSurvivalArea();    // NOTE: No early error exits because we need to execute the    // balancing ExitLastWindowClosingSurvivalArea().    nsCOMPtr<nsICloseAllWindows> closer =            do_CreateInstance("@mozilla.org/appshell/closeallwindows;1", &rv);    NS_ASSERTION(closer, "Failed to create nsICloseAllWindows impl.");    PRBool proceedWithSwitch = PR_FALSE;    if (closer)      rv = closer->CloseAll(PR_TRUE, &proceedWithSwitch);    if (NS_FAILED(rv) || !proceedWithSwitch) {      nsCOMPtr<nsIProfileChangeStatus> changeStatus(do_QueryInterface(aSubject));      if (changeStatus)        changeStatus->VetoChange();    }    ExitLastWindowClosingSurvivalArea();  } else if (!strcmp(aTopic, gProfileInitialStateTopic) &&             nsDependentString(aData).Equals(NS_LITERAL_STRING("switch"))) {    // Now, establish the startup state according to the new prefs.    PRBool openedWindow;    CreateStartupState(SIZE_TO_CONTENT, SIZE_TO_CONTENT, &openedWindow);    if (!openedWindow)      OpenBrowserWindow(SIZE_TO_CONTENT, SIZE_TO_CONTENT);  }  return NS_OK;}