• timothy_horton@apple.com's avatar
    navigator.plugins has plugins in it when plugins are disabled · c70f870b
    timothy_horton@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=119607
    <rdar://problem/14678030>
    
    Reviewed by Anders Carlsson.
    
    Test: plugins/navigator-plugins-disabled.html
    
    * page/Settings.cpp:
    (WebCore::Settings::setPluginsEnabled):
    Refresh the plugin database when plugins are enabled or disabled.
    This is necessary to ensure that navigator.plugins will have the
    correct set of plugins after dynamically changing whether plugins
    are enabled, which makes the test for this patch possible (but it
    makes sense in the browser as well).
    
    * UIProcess/WebProcessProxy.cpp:
    (WebKit::WebProcessProxy::getPlugins):
    Return a list of all plugins, and a list of only application plugins.
    
    * UIProcess/WebProcessProxy.h:
    * UIProcess/WebProcessProxy.messages.in:
    * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
    * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
    (WebKit::WebPlatformStrategies::getPluginInfo):
    Add applicationPlugin parameter to getPlugins, and storage for the returned list.
    
    (WebKit::WebPlatformStrategies::populatePluginCache):
    If plugins are disabled for the given page, give WebCore the list that
    only includes application plugins. Otherwise, give it the whole list
    as we are doing currently.
    
    * WebCoreSupport/WebPlatformStrategies.mm:
    (WebPlatformStrategies::getPluginInfo):
    If plugins are disabled for the given page, give WebCore an empty list of
    plugins. If WebKit1 had any application plugins, we'd return just them
    instead.
    
    Add a test that ensures that navigator.plugins only contains
    application plugins when plugins are disabled.
    
    * plugins/navigator-plugins-disabled-expected.txt: Added.
    * plugins/navigator-plugins-disabled.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c70f870b
navigator-plugins-disabled-expected.txt 8 Bytes