зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1730891 - Set default preferredAction for handling files to save directly to disk on GNOME environments. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D125687
This commit is contained in:
Родитель
0a47b2e410
Коммит
136593a67b
|
@ -3,6 +3,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "nsGNOMERegistry.h"
|
||||
#include "nsString.h"
|
||||
#include "nsMIMEInfoUnix.h"
|
||||
|
@ -93,7 +94,10 @@ already_AddRefed<nsMIMEInfoBase> nsGNOMERegistry::GetFromType(
|
|||
giovfs->GetDescriptionForMimeType(aMIMEType, description);
|
||||
|
||||
mimeInfo->SetDefaultDescription(name);
|
||||
mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
|
||||
|
||||
mozilla::StaticPrefs::browser_download_improvements_to_download_panel()
|
||||
? mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk)
|
||||
: mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
|
||||
mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description));
|
||||
|
||||
return mimeInfo.forget();
|
||||
|
|
Загрузка…
Ссылка в новой задаче