if (!displayDialogPrefValue) { return; } }    rv = strings->CreateBundle(PLUGIN_PROPERTIES_URL, getter_AddRefs(bundle)); if (NS_FAILED(rv)) { return; } rv = strings->CreateBundle(PLUGIN_REGIONAL_URL, getter_AddRefs(regionalBundle)); if (NS_FAILED(rv)) { return; }  PRUnichar *titleUni = nsnull; PRUnichar *messageUni = nsnull; PRUnichar *checkboxMessageUni = nsnull; rv = bundle->GetStringFromName(NS_LITERAL_STRING("noDefaultPluginTitle").get(), &titleUni); if (NS_FAILED(rv)) { goto EXIT_DNDPD; } rv = regionalBundle->GetStringFromName(NS_LITERAL_STRING("noDefaultPluginMessage").get(), &messageUni); if (NS_FAILED(rv)) { goto EXIT_DNDPD; } rv = bundle->GetStringFromName(NS_LITERAL_STRING("noDefaultPluginCheckboxMessage").get(), &checkboxMessageUni); if (NS_FAILED(rv)) { goto EXIT_DNDPD; }  PRInt32 buttonPressed; rv = prompt->ConfirmEx(titleUni, messageUni,
nsCOMPtr<nsIStringBundle> bundle; if (NS_SUCCEEDED(strings->CreateBundle(PLUGIN_PROPERTIES_URL, getter_AddRefs(bundle)))) { nsCOMPtr<nsIStringBundle> regionalBundle; if (NS_SUCCEEDED(strings->CreateBundle(PLUGIN_REGIONAL_URL, getter_AddRefs(regionalBundle)))) { nsXPIDLString titleUni, messageUni, checkboxMessageUni; if (NS_SUCCEEDED(bundle->GetStringFromName( NS_LITERAL_STRING("noDefaultPluginTitle").get(), getter_Copies(titleUni))) && NS_SUCCEEDED(bundle->GetStringFromName( NS_LITERAL_STRING("noDefaultPluginCheckboxMessage").get(), getter_Copies(checkboxMessageUni))) && NS_SUCCEEDED(regionalBundle->GetStringFromName( NS_LITERAL_STRING("noDefaultPluginMessage").get(), getter_Copies(messageUni))) ) { PRBool checkboxState = PR_FALSE; PRInt32 buttonPressed; rv = prompt->ConfirmEx(titleUni, messageUni,
void DisplayNoDefaultPluginDialog(const char *mimeType){  nsresult rv;  if (nsnull == mimeTypesSeen) {    mimeTypesSeen = new nsHashtable(NS_MIME_TYPES_HASH_NUM);  }  if ((mimeTypesSeen != nsnull) && (mimeType != nsnull)) {    nsCStringKey key(mimeType);    // if we've seen this mimetype before    if (mimeTypesSeen->Get(&key)) {      // don't display the dialog      return;    }    else {      mimeTypesSeen->Put(&key, (void *) hashValue);    }  }  nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));  nsCOMPtr<nsIPrompt> prompt;  nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));  if (wwatch)    wwatch->GetNewPrompter(0, getter_AddRefs(prompt));  nsCOMPtr<nsIIOService> io(do_GetService(kIOServiceCID));  nsCOMPtr<nsIStringBundleService> strings(do_GetService(kStringBundleServiceCID));  nsCOMPtr<nsIStringBundle> bundle;  nsCOMPtr<nsIStringBundle> regionalBundle;  nsCOMPtr<nsIURI> uri;  PRBool displayDialogPrefValue = PR_FALSE, checkboxState = PR_FALSE;  if (!prefs || !prompt || !io || !strings) {    return;  }  rv = prefs->GetBoolPref("plugin.display_plugin_downloader_dialog",                           &displayDialogPrefValue);  if (NS_SUCCEEDED(rv)) {    // if the pref is false, don't display the dialog    if (!displayDialogPrefValue) {      return;    }  }    // Taken from mozilla\extensions\wallet\src\wallet.cpp  // WalletLocalize().  rv = strings->CreateBundle(PLUGIN_PROPERTIES_URL, getter_AddRefs(bundle));  if (NS_FAILED(rv)) {    return;  }  rv = strings->CreateBundle(PLUGIN_REGIONAL_URL,                              getter_AddRefs(regionalBundle));  if (NS_FAILED(rv)) {    return;  }  PRUnichar *titleUni = nsnull;  PRUnichar *messageUni = nsnull;  PRUnichar *checkboxMessageUni = nsnull;  rv = bundle->GetStringFromName(NS_LITERAL_STRING("noDefaultPluginTitle").get(),                                  &titleUni);  if (NS_FAILED(rv)) {    goto EXIT_DNDPD;  }  rv = regionalBundle->GetStringFromName(NS_LITERAL_STRING("noDefaultPluginMessage").get(),                                          &messageUni);  if (NS_FAILED(rv)) {    goto EXIT_DNDPD;  }  rv = bundle->GetStringFromName(NS_LITERAL_STRING("noDefaultPluginCheckboxMessage").get(),                                  &checkboxMessageUni);  if (NS_FAILED(rv)) {    goto EXIT_DNDPD;  }  PRInt32 buttonPressed;  rv = prompt->ConfirmEx(titleUni, messageUni,                         nsIPrompt::BUTTON_TITLE_OK * nsIPrompt::BUTTON_POS_0,                         nsnull, nsnull, nsnull,                         checkboxMessageUni, &checkboxState, &buttonPressed);  // if the user checked the checkbox, make it so the dialog doesn't  // display again.  if (checkboxState) {    prefs->SetBoolPref("plugin.display_plugin_downloader_dialog",                       !checkboxState);  } EXIT_DNDPD:  nsMemory::Free((void *)titleUni);  nsMemory::Free((void *)messageUni);  nsMemory::Free((void *)checkboxMessageUni);  return;}