Break pluginReplacementEnabled into youTubeFlashPluginReplacementEnabled and quickTimePluginReplacementEnabled
https://bugs.webkit.org/show_bug.cgi?id=161424
<rdar://problem/28050847>
Patch by Ricky Mondello <rmondello@apple.com> on 2016-08-31
Reviewed by Dean Jackson.
Source/WebCore:
Replace the single pluginReplacementEnabled setting with individual settings for the YouTube Flash plug-in
behavior and the QuickTime plug-in behavior. Unless otherwise noted, this change copies the existing plumbing
for pluginReplacementEnabled and renames it twice. The default values for these settings remain the same.
* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::ReplacementPlugin): Augment the constructor.
(WebCore::ReplacementPlugin::isEnabledBySettings): Added.
* Modules/plugins/QuickTimePluginReplacement.h: Declare a static member function.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
(WebCore::QuickTimePluginReplacement::isEnabledBySettings): Added.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::registerPluginReplacement): Properly create a ReplacementPlugin instance.
(WebCore::YouTubePluginReplacement::isEnabledBySettings): Added.
* Modules/plugins/YouTubePluginReplacement.h: Declare a static member function.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::requestObject): Ask the ReplacementPlugin whether it's enabled, rather than assume
all plug-in replacement is guarded by a single run-time setting.
* page/Settings.cpp: Declare values for defaults for both settings.
* page/Settings.in: Declare two settings.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Handle both settings.
(WebCore::InternalSettings::Backup::restoreTo): Ditto.
(WebCore::InternalSettings::setQuickTimePluginReplacementEnabled): Added.
(WebCore::InternalSettings::setYouTubeFlashPluginReplacementEnabled): Added.
(WebCore::InternalSettings::setPluginReplacementEnabled): Deleted.
* testing/InternalSettings.h: Duplicate and rename.
* testing/InternalSettings.idl: Ditto.
LayoutTests:
* plugins/quicktime-plugin-replacement.html: Updated for the internal setting rename.
* security/contentSecurityPolicy/object-src-none-blocks-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/object-src-none-blocks-youtube-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-allows-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement-without-mime-type.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-quicktime-plugin-replacement.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement-without-mime-type.html: Ditto.
* security/contentSecurityPolicy/plugins-types-blocks-youtube-plugin-replacement.html: Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@205271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed