зеркало из https://github.com/mozilla/gecko-dev.git
Bug 848994 - p5. Check Silverlight presence - r=cpearce
MozReview-Commit-ID: JRzyIWmMTtf
This commit is contained in:
Родитель
b1be604d62
Коммит
04d6608e8c
|
@ -13,6 +13,7 @@
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
#include "nsIWeakReference.h"
|
#include "nsIWeakReference.h"
|
||||||
|
#include "nsPluginHost.h"
|
||||||
|
|
||||||
static mozilla::LazyLogModule sDecoderDoctorLog("DecoderDoctor");
|
static mozilla::LazyLogModule sDecoderDoctorLog("DecoderDoctor");
|
||||||
#define DD_LOG(level, arg, ...) MOZ_LOG(sDecoderDoctorLog, level, (arg, ##__VA_ARGS__))
|
#define DD_LOG(level, arg, ...) MOZ_LOG(sDecoderDoctorLog, level, (arg, ##__VA_ARGS__))
|
||||||
|
@ -293,6 +294,33 @@ DecoderDoctorDocumentWatcher::ReportAnalysis(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum SilverlightPresence {
|
||||||
|
eNoSilverlight,
|
||||||
|
eSilverlightDisabled,
|
||||||
|
eSilverlightEnabled
|
||||||
|
};
|
||||||
|
static SilverlightPresence
|
||||||
|
CheckSilverlight()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
|
||||||
|
if (!pluginHost) {
|
||||||
|
return eNoSilverlight;
|
||||||
|
}
|
||||||
|
nsTArray<nsCOMPtr<nsIInternalPluginTag>> plugins;
|
||||||
|
pluginHost->GetPlugins(plugins, /*aIncludeDisabled*/ true);
|
||||||
|
for (const auto& plugin : plugins) {
|
||||||
|
for (const auto& mime : plugin->MimeTypes()) {
|
||||||
|
if (mime.LowerCaseEqualsLiteral("application/x-silverlight")
|
||||||
|
|| mime.LowerCaseEqualsLiteral("application/x-silverlight-2")) {
|
||||||
|
return plugin->IsEnabled() ? eSilverlightEnabled : eSilverlightDisabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return eNoSilverlight;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
DecoderDoctorDocumentWatcher::SynthesizeAnalysis()
|
DecoderDoctorDocumentWatcher::SynthesizeAnalysis()
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче