Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: Source/web/FrameLoaderClientImpl.cpp

Issue 23618022: BrowserPlugin/WebView - Move plugin lifetime to DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix mac compile issue. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 const KURL& url, 620 const KURL& url,
621 const String& name, 621 const String& name,
622 const String& referrer, 622 const String& referrer,
623 HTMLFrameOwnerElement* ownerElement) 623 HTMLFrameOwnerElement* ownerElement)
624 { 624 {
625 FrameLoadRequest frameRequest(m_webFrame->frame()->document(), 625 FrameLoadRequest frameRequest(m_webFrame->frame()->document(),
626 ResourceRequest(url, referrer), name); 626 ResourceRequest(url, referrer), name);
627 return m_webFrame->createChildFrame(frameRequest, ownerElement); 627 return m_webFrame->createChildFrame(frameRequest, ownerElement);
628 } 628 }
629 629
630 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp e) const
631 {
632 if (!m_webFrame->client())
633 return false;
634
635 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType);
636 }
637
630 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( 638 PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin(
631 const IntSize& size, // FIXME: how do we use this? 639 const IntSize& size, // FIXME: how do we use this?
632 HTMLPlugInElement* element, 640 HTMLPlugInElement* element,
633 const KURL& url, 641 const KURL& url,
634 const Vector<String>& paramNames, 642 const Vector<String>& paramNames,
635 const Vector<String>& paramValues, 643 const Vector<String>& paramValues,
636 const String& mimeType, 644 const String& mimeType,
637 bool loadManually) 645 bool loadManually,
646 PluginLoadType loadType)
638 { 647 {
639 if (!m_webFrame->client()) 648 if (!m_webFrame->client())
640 return 0; 649 return 0;
641 650
642 WebPluginParams params; 651 WebPluginParams params;
643 params.url = url; 652 params.url = url;
644 params.mimeType = mimeType; 653 params.mimeType = mimeType;
645 params.attributeNames = paramNames; 654 params.attributeNames = paramNames;
646 params.attributeValues = paramValues; 655 params.attributeValues = paramValues;
647 params.loadManually = loadManually; 656 params.loadManually = loadManually;
648 657
649 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params ); 658 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params );
650 if (!webPlugin) 659 if (!webPlugin)
651 return 0; 660 return 0;
652 661
653 // The container takes ownership of the WebPlugin. 662 // The container takes ownership of the WebPlugin.
654 RefPtr<WebPluginContainerImpl> container = 663 RefPtr<WebPluginContainerImpl> container =
655 WebPluginContainerImpl::create(element, webPlugin); 664 WebPluginContainerImpl::create(element, webPlugin);
656 665
657 if (!webPlugin->initialize(container.get())) 666 if (!webPlugin->initialize(container.get()))
658 return 0; 667 return 0;
659 668
660 // The element might have been removed during plugin initialization! 669 // The element might have been removed during plugin initialization!
661 if (!element->renderer()) 670 if (!element->renderer() && loadType != PluginLoadWithoutRenderer)
662 return 0; 671 return 0;
663 672
664 return container; 673 return container;
665 } 674 }
666 675
667 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( 676 PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
668 const IntSize& size, 677 const IntSize& size,
669 HTMLAppletElement* element, 678 HTMLAppletElement* element,
670 const KURL& /* baseURL */, 679 const KURL& /* baseURL */,
671 const Vector<String>& paramNames, 680 const Vector<String>& paramNames,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 return adoptPtr(m_webFrame->client()->createServiceWorkerProvider(m_webFrame , client.leakPtr())); 821 return adoptPtr(m_webFrame->client()->createServiceWorkerProvider(m_webFrame , client.leakPtr()));
813 } 822 }
814 823
815 void FrameLoaderClientImpl::didStopAllLoaders() 824 void FrameLoaderClientImpl::didStopAllLoaders()
816 { 825 {
817 if (m_webFrame->client()) 826 if (m_webFrame->client())
818 m_webFrame->client()->didAbortLoading(m_webFrame); 827 m_webFrame->client()->didAbortLoading(m_webFrame);
819 } 828 }
820 829
821 } // namespace blink 830 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698