Bug 266289 nsIAlertsService should use AString instead of wstring

r=mscott sr=neil


git-svn-id: svn://10.0.0.236/trunk@168491 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cst%andrew.cmu.edu 2005-01-29 01:04:32 +00:00
parent c53e5bb3d3
commit e185ae1bdb
4 changed files with 15 additions and 15 deletions

View File

@ -485,8 +485,8 @@ nsresult nsMessengerWinIntegration::ShowAlertMessage(const PRUnichar * aAlertTit
nsCOMPtr<nsIAlertsService> alertsService (do_GetService(NS_ALERTSERVICE_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv))
{
rv = alertsService->ShowAlertNotification(NEW_MAIL_ALERT_ICON, aAlertTitle, aAlertText, PR_TRUE,
NS_ConvertASCIItoUCS2(aFolderURI).get(), this);
rv = alertsService->ShowAlertNotification(NS_LITERAL_STRING(NEW_MAIL_ALERT_ICON), nsDependentString(aAlertTitle), nsDependentString(aAlertText), PR_TRUE,
NS_ConvertASCIItoUCS2(aFolderURI), this);
mAlertInProgress = PR_TRUE;
}
}

View File

@ -55,9 +55,9 @@ interface nsIAlertsService : nsISupports
alert goes away, or "alertclickcallback" when the text is clicked. Data
is aAlertCookie.
*/
void showAlertNotification(in string aImageUrl, in wstring aAlertTitle,
in wstring aAlertText, in boolean alertTextClickable,
in wstring aAlertCookie,
void showAlertNotification(in AString aImageUrl, in AString aAlertTitle,
in AString aAlertText, in boolean alertTextClickable,
in AString aAlertCookie,
in nsIObserver aAlertListener );
};

View File

@ -62,9 +62,9 @@ nsAlertsService::nsAlertsService()
nsAlertsService::~nsAlertsService()
{}
NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, const PRUnichar * aAlertTitle,
const PRUnichar * aAlertText, PRBool aAlertTextClickable,
const PRUnichar * aAlertCookie,
NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle,
const nsAString & aAlertText, PRBool aAlertTextClickable,
const nsAString & aAlertCookie,
nsIObserver * aAlertListener)
{
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
@ -76,22 +76,22 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, con
NS_ENSURE_SUCCESS(rv, rv);
// create scriptable versions of our strings that we can store in our nsISupportsArray....
nsCOMPtr<nsISupportsCString> scriptableImageUrl (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
nsCOMPtr<nsISupportsString> scriptableImageUrl (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableImageUrl, NS_ERROR_FAILURE);
scriptableImageUrl->SetData(nsDependentCString(aImageUrl));
scriptableImageUrl->SetData(aImageUrl);
argsArray->AppendElement(scriptableImageUrl);
nsCOMPtr<nsISupportsString> scriptableAlertTitle (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableAlertTitle, NS_ERROR_FAILURE);
scriptableAlertTitle->SetData(nsDependentString(aAlertTitle));
scriptableAlertTitle->SetData(aAlertTitle);
argsArray->AppendElement(scriptableAlertTitle);
nsCOMPtr<nsISupportsString> scriptableAlertText (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableAlertText, NS_ERROR_FAILURE);
scriptableAlertText->SetData(nsDependentString(aAlertText));
scriptableAlertText->SetData(aAlertText);
argsArray->AppendElement(scriptableAlertText);
nsCOMPtr<nsISupportsPRBool> scriptableIsClickable (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID));
@ -103,7 +103,7 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const char * aImageUrl, con
nsCOMPtr<nsISupportsString> scriptableAlertCookie (do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
NS_ENSURE_TRUE(scriptableAlertCookie, NS_ERROR_FAILURE);
scriptableAlertCookie->SetData(nsDependentString(aAlertCookie));
scriptableAlertCookie->SetData(aAlertCookie);
argsArray->AppendElement(scriptableAlertCookie);
if (aAlertListener)

View File

@ -1184,9 +1184,9 @@ void nsDownload::DisplayDownloadFinishedAlert()
nsCAutoString url;
mTarget->GetSpec(url);
alertsService->ShowAlertNotification(PromiseFlatCString(NS_LITERAL_CSTRING("moz-icon://") + url).get(),
alertsService->ShowAlertNotification(NS_LITERAL_STRING("moz-icon://") + NS_ConvertUTF8toUTF16(url),
finishedTitle, finishedText, PR_TRUE,
NS_LITERAL_STRING("download").get(), this);
NS_LITERAL_STRING("download"), this);
}
NS_IMETHODIMP