/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * 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/. */
// These plugin and mime types are hard-coded by the HTML spec. // The "main" plugin name is used with the only plugin that is // referenced by MIME types (via nsMimeType::GetEnabledPlugin). // The "extra" of the plugin names are associated with MIME types that // reference the main plugin. // This is all defined in the HTML spec, section 8.9.1.6 // "PDF Viewing Support". staticconst nsLiteralString kMainPluginName = u"PDF Viewer"_ns; staticconst nsLiteralString kExtraPluginNames[] = {
u"Chrome PDF Viewer"_ns, u"Chromium PDF Viewer"_ns,
u"Microsoft Edge PDF Viewer"_ns, u"WebKit built-in PDF"_ns}; staticconst nsLiteralString kMimeTypeNames[] = {u"application/pdf"_ns,
u"text/pdf"_ns};
nsPluginArray::nsPluginArray(nsPIDOMWindowInner* aWindow) : mWindow(aWindow) { // Create the hard-coded PDF plugin types that share MIME type arrays.
mPlugins[0] = MakeRefPtr<nsPluginElement>(this, aWindow, kMainPluginName);
mozilla::Array<RefPtr<nsMimeType>, 2> mimeTypes; for (uint32_t i = 0; i < std::size(kMimeTypeNames); ++i) {
mimeTypes[i] = MakeRefPtr<nsMimeType>(mPlugins[0], kMimeTypeNames[i]);
}
mMimeTypeArray = MakeRefPtr<nsMimeTypeArray>(aWindow, mimeTypes);
for (uint32_t i = 0; i < std::size(kExtraPluginNames); ++i) {
mPlugins[i + 1] =
MakeRefPtr<nsPluginElement>(this, aWindow, kExtraPluginNames[i]);
}
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.17Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.