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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 const KURL& url, | 585 const KURL& url, |
586 const String& name, | 586 const String& name, |
587 const String& referrer, | 587 const String& referrer, |
588 HTMLFrameOwnerElement* ownerElement) | 588 HTMLFrameOwnerElement* ownerElement) |
589 { | 589 { |
590 FrameLoadRequest frameRequest(m_webFrame->frame()->document(), | 590 FrameLoadRequest frameRequest(m_webFrame->frame()->document(), |
591 ResourceRequest(url, referrer), name); | 591 ResourceRequest(url, referrer), name); |
592 return m_webFrame->createChildFrame(frameRequest, ownerElement); | 592 return m_webFrame->createChildFrame(frameRequest, ownerElement); |
593 } | 593 } |
594 | 594 |
| 595 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp
e) const |
| 596 { |
| 597 if (!m_webFrame->client()) |
| 598 return false; |
| 599 |
| 600 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType); |
| 601 } |
| 602 |
595 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( | 603 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( |
596 const IntSize& size, // FIXME: how do we use this? | 604 const IntSize& size, // FIXME: how do we use this? |
597 HTMLPlugInElement* element, | 605 HTMLPlugInElement* element, |
598 const KURL& url, | 606 const KURL& url, |
599 const Vector<String>& paramNames, | 607 const Vector<String>& paramNames, |
600 const Vector<String>& paramValues, | 608 const Vector<String>& paramValues, |
601 const String& mimeType, | 609 const String& mimeType, |
602 bool loadManually) | 610 bool loadManually, |
| 611 PluginLoadType loadType) |
603 { | 612 { |
604 if (!m_webFrame->client()) | 613 if (!m_webFrame->client()) |
605 return 0; | 614 return 0; |
606 | 615 |
607 WebPluginParams params; | 616 WebPluginParams params; |
608 params.url = url; | 617 params.url = url; |
609 params.mimeType = mimeType; | 618 params.mimeType = mimeType; |
610 params.attributeNames = paramNames; | 619 params.attributeNames = paramNames; |
611 params.attributeValues = paramValues; | 620 params.attributeValues = paramValues; |
612 params.loadManually = loadManually; | 621 params.loadManually = loadManually; |
613 | 622 |
614 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); | 623 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); |
615 if (!webPlugin) | 624 if (!webPlugin) |
616 return 0; | 625 return 0; |
617 | 626 |
618 // The container takes ownership of the WebPlugin. | 627 // The container takes ownership of the WebPlugin. |
619 RefPtr<WebPluginContainerImpl> container = | 628 RefPtr<WebPluginContainerImpl> container = |
620 WebPluginContainerImpl::create(element, webPlugin); | 629 WebPluginContainerImpl::create(element, webPlugin); |
621 | 630 |
622 if (!webPlugin->initialize(container.get())) | 631 if (!webPlugin->initialize(container.get())) |
623 return 0; | 632 return 0; |
624 | 633 |
625 // The element might have been removed during plugin initialization! | 634 // The element might have been removed during plugin initialization! |
626 if (!element->renderer()) | 635 if (!element->renderer() && loadType != PluginLoadWithoutRenderer) |
627 return 0; | 636 return 0; |
628 | 637 |
629 return container; | 638 return container; |
630 } | 639 } |
631 | 640 |
632 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( | 641 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( |
633 const IntSize& size, | 642 const IntSize& size, |
634 HTMLAppletElement* element, | 643 HTMLAppletElement* element, |
635 const KURL& /* baseURL */, | 644 const KURL& /* baseURL */, |
636 const Vector<String>& paramNames, | 645 const Vector<String>& paramNames, |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 return m_webFrame->sharedWorkerRepositoryClient(); | 787 return m_webFrame->sharedWorkerRepositoryClient(); |
779 } | 788 } |
780 | 789 |
781 void FrameLoaderClientImpl::didStopAllLoaders() | 790 void FrameLoaderClientImpl::didStopAllLoaders() |
782 { | 791 { |
783 if (m_webFrame->client()) | 792 if (m_webFrame->client()) |
784 m_webFrame->client()->didAbortLoading(m_webFrame); | 793 m_webFrame->client()->didAbortLoading(m_webFrame); |
785 } | 794 } |
786 | 795 |
787 } // namespace blink | 796 } // namespace blink |
OLD | NEW |