OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 } | 1784 } |
1785 | 1785 |
1786 blink::WebPlugin* RenderFrameImpl::CreatePlugin( | 1786 blink::WebPlugin* RenderFrameImpl::CreatePlugin( |
1787 blink::WebFrame* frame, | 1787 blink::WebFrame* frame, |
1788 const WebPluginInfo& info, | 1788 const WebPluginInfo& info, |
1789 const blink::WebPluginParams& params, | 1789 const blink::WebPluginParams& params, |
1790 scoped_ptr<content::PluginInstanceThrottler> throttler) { | 1790 scoped_ptr<content::PluginInstanceThrottler> throttler) { |
1791 DCHECK_EQ(frame_, frame); | 1791 DCHECK_EQ(frame_, frame); |
1792 #if defined(ENABLE_PLUGINS) | 1792 #if defined(ENABLE_PLUGINS) |
1793 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { | 1793 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { |
1794 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( | 1794 return BrowserPluginManager::Get()->CreateBrowserPlugin( |
| 1795 this, |
1795 GetContentClient()->renderer()->CreateBrowserPluginDelegate( | 1796 GetContentClient()->renderer()->CreateBrowserPluginDelegate( |
1796 this, params.mimeType.utf8(), GURL(params.url))); | 1797 this, params.mimeType.utf8(), GURL(params.url))); |
1797 return BrowserPluginManager::Get()->CreateBrowserPlugin( | |
1798 this, browser_plugin_delegate.Pass()); | |
1799 } | 1798 } |
1800 | 1799 |
1801 bool pepper_plugin_was_registered = false; | 1800 bool pepper_plugin_was_registered = false; |
1802 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( | 1801 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( |
1803 this, info, &pepper_plugin_was_registered)); | 1802 this, info, &pepper_plugin_was_registered)); |
1804 if (pepper_plugin_was_registered) { | 1803 if (pepper_plugin_was_registered) { |
1805 if (pepper_module.get()) { | 1804 if (pepper_module.get()) { |
1806 return new PepperWebPluginImpl( | 1805 return new PepperWebPluginImpl( |
1807 pepper_module.get(), params, this, | 1806 pepper_module.get(), params, this, |
1808 make_scoped_ptr( | 1807 make_scoped_ptr( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 blink::WebLocalFrame* frame, | 1903 blink::WebLocalFrame* frame, |
1905 const blink::WebPluginParams& params) { | 1904 const blink::WebPluginParams& params) { |
1906 DCHECK_EQ(frame_, frame); | 1905 DCHECK_EQ(frame_, frame); |
1907 blink::WebPlugin* plugin = NULL; | 1906 blink::WebPlugin* plugin = NULL; |
1908 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 1907 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
1909 this, frame, params, &plugin)) { | 1908 this, frame, params, &plugin)) { |
1910 return plugin; | 1909 return plugin; |
1911 } | 1910 } |
1912 | 1911 |
1913 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { | 1912 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { |
1914 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( | 1913 return BrowserPluginManager::Get()->CreateBrowserPlugin( |
| 1914 this, |
1915 GetContentClient()->renderer()->CreateBrowserPluginDelegate(this, | 1915 GetContentClient()->renderer()->CreateBrowserPluginDelegate(this, |
1916 kBrowserPluginMimeType, GURL(params.url))); | 1916 kBrowserPluginMimeType, GURL(params.url))); |
1917 return BrowserPluginManager::Get()->CreateBrowserPlugin( | |
1918 this, browser_plugin_delegate.Pass()); | |
1919 } | 1917 } |
1920 | 1918 |
1921 #if defined(ENABLE_PLUGINS) | 1919 #if defined(ENABLE_PLUGINS) |
1922 WebPluginInfo info; | 1920 WebPluginInfo info; |
1923 std::string mime_type; | 1921 std::string mime_type; |
1924 bool found = false; | 1922 bool found = false; |
1925 Send(new FrameHostMsg_GetPluginInfo( | 1923 Send(new FrameHostMsg_GetPluginInfo( |
1926 routing_id_, params.url, frame->top()->document().url(), | 1924 routing_id_, params.url, frame->top()->document().url(), |
1927 params.mimeType.utf8(), &found, &info, &mime_type)); | 1925 params.mimeType.utf8(), &found, &info, &mime_type)); |
1928 if (!found) | 1926 if (!found) |
(...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4913 #elif defined(ENABLE_BROWSER_CDMS) | 4911 #elif defined(ENABLE_BROWSER_CDMS) |
4914 cdm_manager_, | 4912 cdm_manager_, |
4915 #endif | 4913 #endif |
4916 this); | 4914 this); |
4917 } | 4915 } |
4918 | 4916 |
4919 return cdm_factory_; | 4917 return cdm_factory_; |
4920 } | 4918 } |
4921 | 4919 |
4922 } // namespace content | 4920 } // namespace content |
OLD | NEW |