NS_IMETHODIMP nsAutoConfig::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData) { nsresult rv = NS_OK; if (!nsCRT::strcmp(aTopic, "profile-after-change")) { // Getting the current profile name since we already have the // pointer to the object. nsCOMPtr<nsIProfile> profile = do_QueryInterface(aSubject); if (profile) { nsXPIDLString profileName; rv = profile->GetCurrentProfile(getter_Copies(profileName)); if (NS_SUCCEEDED(rv)) { // setting the member variable to the current profile name CopyUTF16toUTF8(profileName, mCurrProfile); } else { NS_WARNING("nsAutoConfig::GetCurrentProfile() failed"); } } // We will be calling downloadAutoConfig even if there is no profile // name. Nothing will be passed as a parameter to the URL and the // default case will be picked up by the script. rv = downloadAutoConfig(); } return rv; }
NS_IMETHODIMP nsAutoConfig::Observe(nsISupports *aSubject, const char *aTopic, const char16_t *someData) { nsresult rv = NS_OK; if (!nsCRT::strcmp(aTopic, "profile-after-change")) { // We will be calling downloadAutoConfig even if there is no profile // name. Nothing will be passed as a parameter to the URL and the // default case will be picked up by the script. rv = downloadAutoConfig(); } return rv; }
// Notify method as a TimerCallBack function NS_IMETHODIMP nsAutoConfig::Notify(nsITimer *timer) { downloadAutoConfig(); return NS_OK; }