| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 const KURL& url, | 578 const KURL& url, |
| 579 const String& name, | 579 const String& name, |
| 580 const String& referrer, | 580 const String& referrer, |
| 581 HTMLFrameOwnerElement* ownerElement) | 581 HTMLFrameOwnerElement* ownerElement) |
| 582 { | 582 { |
| 583 FrameLoadRequest frameRequest(m_webFrame->frame()->document()->securityOrigi
n(), | 583 FrameLoadRequest frameRequest(m_webFrame->frame()->document()->securityOrigi
n(), |
| 584 ResourceRequest(url, referrer), name); | 584 ResourceRequest(url, referrer), name); |
| 585 return m_webFrame->createChildFrame(frameRequest, ownerElement); | 585 return m_webFrame->createChildFrame(frameRequest, ownerElement); |
| 586 } | 586 } |
| 587 | 587 |
| 588 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp
e) const |
| 589 { |
| 590 if (!m_webFrame->client()) |
| 591 return false; |
| 592 |
| 593 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType); |
| 594 } |
| 595 |
| 588 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( | 596 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( |
| 589 const IntSize& size, // FIXME: how do we use this? | 597 const IntSize& size, // FIXME: how do we use this? |
| 590 HTMLPlugInElement* element, | 598 HTMLPlugInElement* element, |
| 591 const KURL& url, | 599 const KURL& url, |
| 592 const Vector<String>& paramNames, | 600 const Vector<String>& paramNames, |
| 593 const Vector<String>& paramValues, | 601 const Vector<String>& paramValues, |
| 594 const String& mimeType, | 602 const String& mimeType, |
| 595 bool loadManually) | 603 bool loadManually, |
| 604 bool loadWithoutRenderer) |
| 596 { | 605 { |
| 597 if (!m_webFrame->client()) | 606 if (!m_webFrame->client()) |
| 598 return 0; | 607 return 0; |
| 599 | 608 |
| 600 WebPluginParams params; | 609 WebPluginParams params; |
| 601 params.url = url; | 610 params.url = url; |
| 602 params.mimeType = mimeType; | 611 params.mimeType = mimeType; |
| 603 params.attributeNames = paramNames; | 612 params.attributeNames = paramNames; |
| 604 params.attributeValues = paramValues; | 613 params.attributeValues = paramValues; |
| 605 params.loadManually = loadManually; | 614 params.loadManually = loadManually; |
| 606 | 615 |
| 607 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); | 616 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); |
| 608 if (!webPlugin) | 617 if (!webPlugin) |
| 609 return 0; | 618 return 0; |
| 610 | 619 |
| 611 // The container takes ownership of the WebPlugin. | 620 // The container takes ownership of the WebPlugin. |
| 612 RefPtr<WebPluginContainerImpl> container = | 621 RefPtr<WebPluginContainerImpl> container = |
| 613 WebPluginContainerImpl::create(element, webPlugin); | 622 WebPluginContainerImpl::create(element, webPlugin); |
| 614 | 623 |
| 615 if (!webPlugin->initialize(container.get())) | 624 if (!webPlugin->initialize(container.get())) |
| 616 return 0; | 625 return 0; |
| 617 | 626 |
| 618 // The element might have been removed during plugin initialization! | 627 // The element might have been removed during plugin initialization! |
| 619 if (!element->renderer()) | 628 if (!element->renderer() && !loadWithoutRenderer) |
| 620 return 0; | 629 return 0; |
| 621 | 630 |
| 622 return container; | 631 return container; |
| 623 } | 632 } |
| 624 | 633 |
| 625 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( | 634 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( |
| 626 const IntSize& size, | 635 const IntSize& size, |
| 627 HTMLAppletElement* element, | 636 HTMLAppletElement* element, |
| 628 const KURL& /* baseURL */, | 637 const KURL& /* baseURL */, |
| 629 const Vector<String>& paramNames, | 638 const Vector<String>& paramNames, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 return m_webFrame->client()->serviceWorkerRegistry(m_webFrame); | 768 return m_webFrame->client()->serviceWorkerRegistry(m_webFrame); |
| 760 } | 769 } |
| 761 | 770 |
| 762 void FrameLoaderClientImpl::didStopAllLoaders() | 771 void FrameLoaderClientImpl::didStopAllLoaders() |
| 763 { | 772 { |
| 764 if (m_webFrame->client()) | 773 if (m_webFrame->client()) |
| 765 m_webFrame->client()->didAbortLoading(m_webFrame); | 774 m_webFrame->client()->didAbortLoading(m_webFrame); |
| 766 } | 775 } |
| 767 | 776 |
| 768 } // namespace WebKit | 777 } // namespace WebKit |
| OLD | NEW |