equal
deleted
inserted
replaced
939 +#endif |
939 +#endif |
940 diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp |
940 diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp |
941 new file mode 100644 |
941 new file mode 100644 |
942 --- /dev/null |
942 --- /dev/null |
943 +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp |
943 +++ b/uriloader/exthandler/unix/nsKDERegistry.cpp |
944 @@ -0,0 +1,86 @@ |
944 @@ -0,0 +1,89 @@ |
945 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
945 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
946 +/* This Source Code Form is subject to the terms of the Mozilla Public |
946 +/* This Source Code Form is subject to the terms of the Mozilla Public |
947 + * License, v. 2.0. If a copy of the MPL was not distributed with this |
947 + * License, v. 2.0. If a copy of the MPL was not distributed with this |
948 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
948 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
949 + |
949 + |
|
950 +#include "mozilla/StaticPrefs_browser.h" |
950 +#include "nsKDERegistry.h" |
951 +#include "nsKDERegistry.h" |
951 +#include "prlink.h" |
952 +#include "prlink.h" |
952 +#include "prmem.h" |
953 +#include "prmem.h" |
953 +#include "nsString.h" |
954 +#include "nsString.h" |
954 +#include "nsMIMEInfoUnix.h" |
955 +#include "nsMIMEInfoUnix.h" |
1020 + RefPtr<nsMIMEInfoUnix> mimeInfo = new nsMIMEInfoUnix( mimetype ); |
1021 + RefPtr<nsMIMEInfoUnix> mimeInfo = new nsMIMEInfoUnix( mimetype ); |
1021 + NS_ENSURE_TRUE(mimeInfo, nullptr); |
1022 + NS_ENSURE_TRUE(mimeInfo, nullptr); |
1022 + nsCString description = output[ 1 ]; |
1023 + nsCString description = output[ 1 ]; |
1023 + mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); |
1024 + mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description)); |
1024 + nsCString handlerAppName = output[ 2 ]; |
1025 + nsCString handlerAppName = output[ 2 ]; |
|
1026 + mozilla::StaticPrefs::browser_download_improvements_to_download_panel() |
|
1027 + ? mimeInfo->SetPreferredAction(nsIMIMEInfo::saveToDisk) |
|
1028 + : mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); |
1025 + mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); |
1029 + mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName)); |
1026 + mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault); |
|
1027 + return mimeInfo.forget(); |
1030 + return mimeInfo.forget(); |
1028 + } |
1031 + } |
1029 + return nullptr; |
1032 + return nullptr; |
1030 +} |
1033 +} |
1031 diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h |
1034 diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h |