mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
Bug 773942 - Use a generic string for the PDF description since it is not necessarily tied to the default handler. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D72777
This commit is contained in:
parent
3074d7ebb9
commit
e2e5ff74a3
@ -16,3 +16,4 @@ unknownCancel.label=Cancel
|
||||
fileType=%S file
|
||||
# LOCALIZATION NOTE (orderedFileSizeWithType): first %S is type, second %S is size, and third %S is unit
|
||||
orderedFileSizeWithType=%1$S (%2$S %3$S)
|
||||
pdfHandlerDescription=Portable Document Format
|
||||
|
@ -2465,6 +2465,28 @@ NS_IMETHODIMP nsExternalHelperAppService::GetFromTypeAndExtension(
|
||||
// If we got no mimeinfo, something went wrong. Probably lack of memory.
|
||||
if (!*_retval) return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// (1.5) Overwrite with generic description if the extension is PDF
|
||||
// since the file format is supported by Firefox and we don't want
|
||||
// other brands positioning themselves as the sole viewer for a system.
|
||||
if (aFileExt.LowerCaseEqualsASCII("pdf") ||
|
||||
aFileExt.LowerCaseEqualsASCII(".pdf")) {
|
||||
nsCOMPtr<nsIStringBundleService> bundleService =
|
||||
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIStringBundle> unknownContentTypeBundle;
|
||||
rv = bundleService->CreateBundle(
|
||||
"chrome://mozapps/locale/downloads/unknownContentType.properties",
|
||||
getter_AddRefs(unknownContentTypeBundle));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAutoString pdfHandlerDescription;
|
||||
rv = unknownContentTypeBundle->GetStringFromName("pdfHandlerDescription",
|
||||
pdfHandlerDescription);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
(*_retval)->SetDescription(pdfHandlerDescription);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// (2) Now, let's see if we can find something in our datastore
|
||||
// This will not overwrite the OS information that interests us
|
||||
// (i.e. default application, default app. description)
|
||||
|
Loading…
Reference in New Issue
Block a user