Changeset 53681 in webkit


Ignore:
Timestamp:
Jan 21, 2010 11:11:24 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-21 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

[chromium] Add allowPlugins callback to allow per-site enabling of plugins
https://bugs.webkit.org/show_bug.cgi?id=33974

Add a callback into the FrameLoaderClient to let the embedder enable or
disable plugins on a per-site basis.

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::requestObject):
  • loader/FrameLoaderClient.h: (WebCore::FrameLoaderClient::allowPlugins):

2010-01-21 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

[chromium] Add allowPlugins callback to allow per-site enabling of plugins
https://bugs.webkit.org/show_bug.cgi?id=33974

Forward the new allowPlugins callback to WebKitClient so that it can
make the policy decision.

  • public/WebFrameClient.h: (WebKit::WebFrameClient::allowPlugins):
  • src/FrameLoaderClientImpl.cpp: (WebKit::FrameLoaderClientImpl::allowJavaScript): (WebKit::FrameLoaderClientImpl::allowPlugins):
  • src/FrameLoaderClientImpl.h:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r53680 r53681  
     12010-01-21  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [chromium] Add allowPlugins callback to allow per-site enabling of plugins
     6        https://bugs.webkit.org/show_bug.cgi?id=33974
     7
     8        Add a callback into the FrameLoaderClient to let the embedder enable or
     9        disable plugins on a per-site basis.
     10
     11        * loader/FrameLoader.cpp:
     12        (WebCore::FrameLoader::requestObject):
     13        * loader/FrameLoaderClient.h:
     14        (WebCore::FrameLoaderClient::allowPlugins):
     15
    1162010-01-21  Tony Chang  <tony@chromium.org>
    217
  • trunk/WebCore/loader/FrameLoader.cpp

    r53655 r53681  
    12751275    if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) {
    12761276        Settings* settings = m_frame->settings();
    1277         if (!settings || !settings->arePluginsEnabled() ||
    1278             (!settings->isJavaEnabled() && MIMETypeRegistry::isJavaAppletMIMEType(mimeType)))
     1277        if (!m_client->allowPlugins(settings && settings->arePluginsEnabled())
     1278            || (!settings->isJavaEnabled() && MIMETypeRegistry::isJavaAppletMIMEType(mimeType)))
    12791279            return false;
    12801280        if (isSandboxed(SandboxPlugins))
  • trunk/WebCore/loader/FrameLoaderClient.h

    r51644 r53681  
    258258
    259259        virtual bool allowJavaScript(bool enabledPerSettings) { return enabledPerSettings; }
     260        virtual bool allowPlugins(bool enabledPerSettings) { return enabledPerSettings; }
    260261    };
    261262
  • trunk/WebKit/chromium/ChangeLog

    r53678 r53681  
     12010-01-21  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        [chromium] Add allowPlugins callback to allow per-site enabling of plugins
     6        https://bugs.webkit.org/show_bug.cgi?id=33974
     7
     8        Forward the new allowPlugins callback to WebKitClient so that it can
     9        make the policy decision.
     10
     11        * public/WebFrameClient.h:
     12        (WebKit::WebFrameClient::allowPlugins):
     13        * src/FrameLoaderClientImpl.cpp:
     14        (WebKit::FrameLoaderClientImpl::allowJavaScript):
     15        (WebKit::FrameLoaderClientImpl::allowPlugins):
     16        * src/FrameLoaderClientImpl.h:
     17
    1182010-01-21  James Robinson  <jamesr@chromium.org>
    219
  • trunk/WebKit/chromium/public/WebFrameClient.h

    r50685 r53681  
    8181    virtual void willClose(WebFrame*) { }
    8282
     83    // Controls whether plugins are allowed for this frame.
     84    virtual bool allowPlugins(WebFrame*, bool enabledPerSettings) { return enabledPerSettings; }
    8385
    8486    // Load commands -------------------------------------------------------
  • trunk/WebKit/chromium/src/FrameLoaderClientImpl.cpp

    r52937 r53681  
    161161    if (m_webFrame->client())
    162162        return m_webFrame->client()->allowScript(m_webFrame, enabledPerSettings);
     163
     164    return enabledPerSettings;
     165}
     166
     167bool FrameLoaderClientImpl::allowPlugins(bool enabledPerSettings)
     168{
     169    if (m_webFrame->client())
     170        return m_webFrame->client()->allowPlugins(m_webFrame, enabledPerSettings);
    163171
    164172    return enabledPerSettings;
  • trunk/WebKit/chromium/src/FrameLoaderClientImpl.h

    r52698 r53681  
    193193    virtual void didChangeScrollOffset();
    194194    virtual bool allowJavaScript(bool enabledPerSettings);
     195    virtual bool allowPlugins(bool enabledPerSettings);
    195196
    196197private:
Note: See TracChangeset for help on using the changeset viewer.