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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "content/common/swapped_out_messages.h" | 44 #include "content/common/swapped_out_messages.h" |
45 #include "content/common/view_messages.h" | 45 #include "content/common/view_messages.h" |
46 #include "content/public/common/bindings_policy.h" | 46 #include "content/public/common/bindings_policy.h" |
47 #include "content/public/common/content_constants.h" | 47 #include "content/public/common/content_constants.h" |
48 #include "content/public/common/content_switches.h" | 48 #include "content/public/common/content_switches.h" |
49 #include "content/public/common/context_menu_params.h" | 49 #include "content/public/common/context_menu_params.h" |
50 #include "content/public/common/page_state.h" | 50 #include "content/public/common/page_state.h" |
51 #include "content/public/common/resource_response.h" | 51 #include "content/public/common/resource_response.h" |
52 #include "content/public/common/url_constants.h" | 52 #include "content/public/common/url_constants.h" |
53 #include "content/public/common/url_utils.h" | 53 #include "content/public/common/url_utils.h" |
54 #include "content/public/renderer/browser_plugin_delegate.h" | |
55 #include "content/public/renderer/content_renderer_client.h" | 54 #include "content/public/renderer/content_renderer_client.h" |
56 #include "content/public/renderer/context_menu_client.h" | 55 #include "content/public/renderer/context_menu_client.h" |
57 #include "content/public/renderer/document_state.h" | 56 #include "content/public/renderer/document_state.h" |
58 #include "content/public/renderer/isolated_world_ids.h" | 57 #include "content/public/renderer/isolated_world_ids.h" |
59 #include "content/public/renderer/navigation_state.h" | 58 #include "content/public/renderer/navigation_state.h" |
60 #include "content/public/renderer/render_frame_observer.h" | 59 #include "content/public/renderer/render_frame_observer.h" |
61 #include "content/public/renderer/renderer_ppapi_host.h" | 60 #include "content/public/renderer/renderer_ppapi_host.h" |
62 #include "content/renderer/accessibility/renderer_accessibility.h" | 61 #include "content/renderer/accessibility/renderer_accessibility.h" |
63 #include "content/renderer/browser_plugin/browser_plugin.h" | 62 #include "content/renderer/browser_plugin/browser_plugin.h" |
64 #include "content/renderer/browser_plugin/browser_plugin_manager.h" | 63 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 } | 1783 } |
1785 | 1784 |
1786 blink::WebPlugin* RenderFrameImpl::CreatePlugin( | 1785 blink::WebPlugin* RenderFrameImpl::CreatePlugin( |
1787 blink::WebFrame* frame, | 1786 blink::WebFrame* frame, |
1788 const WebPluginInfo& info, | 1787 const WebPluginInfo& info, |
1789 const blink::WebPluginParams& params, | 1788 const blink::WebPluginParams& params, |
1790 scoped_ptr<content::PluginInstanceThrottler> throttler) { | 1789 scoped_ptr<content::PluginInstanceThrottler> throttler) { |
1791 DCHECK_EQ(frame_, frame); | 1790 DCHECK_EQ(frame_, frame); |
1792 #if defined(ENABLE_PLUGINS) | 1791 #if defined(ENABLE_PLUGINS) |
1793 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { | 1792 if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) { |
1794 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( | |
1795 GetContentClient()->renderer()->CreateBrowserPluginDelegate( | |
1796 this, params.mimeType.utf8(), GURL(params.url))); | |
1797 return BrowserPluginManager::Get()->CreateBrowserPlugin( | 1793 return BrowserPluginManager::Get()->CreateBrowserPlugin( |
1798 this, browser_plugin_delegate.Pass()); | 1794 this, params.mimeType.utf8(), GURL(params.url)); |
1799 } | 1795 } |
1800 | 1796 |
1801 bool pepper_plugin_was_registered = false; | 1797 bool pepper_plugin_was_registered = false; |
1802 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( | 1798 scoped_refptr<PluginModule> pepper_module(PluginModule::Create( |
1803 this, info, &pepper_plugin_was_registered)); | 1799 this, info, &pepper_plugin_was_registered)); |
1804 if (pepper_plugin_was_registered) { | 1800 if (pepper_plugin_was_registered) { |
1805 if (pepper_module.get()) { | 1801 if (pepper_module.get()) { |
1806 return new PepperWebPluginImpl( | 1802 return new PepperWebPluginImpl( |
1807 pepper_module.get(), params, this, | 1803 pepper_module.get(), params, this, |
1808 make_scoped_ptr( | 1804 make_scoped_ptr( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1904 blink::WebLocalFrame* frame, | 1900 blink::WebLocalFrame* frame, |
1905 const blink::WebPluginParams& params) { | 1901 const blink::WebPluginParams& params) { |
1906 DCHECK_EQ(frame_, frame); | 1902 DCHECK_EQ(frame_, frame); |
1907 blink::WebPlugin* plugin = NULL; | 1903 blink::WebPlugin* plugin = NULL; |
1908 if (GetContentClient()->renderer()->OverrideCreatePlugin( | 1904 if (GetContentClient()->renderer()->OverrideCreatePlugin( |
1909 this, frame, params, &plugin)) { | 1905 this, frame, params, &plugin)) { |
1910 return plugin; | 1906 return plugin; |
1911 } | 1907 } |
1912 | 1908 |
1913 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { | 1909 if (base::UTF16ToUTF8(params.mimeType) == kBrowserPluginMimeType) { |
1914 scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate( | |
1915 GetContentClient()->renderer()->CreateBrowserPluginDelegate(this, | |
1916 kBrowserPluginMimeType, GURL(params.url))); | |
1917 return BrowserPluginManager::Get()->CreateBrowserPlugin( | 1910 return BrowserPluginManager::Get()->CreateBrowserPlugin( |
1918 this, browser_plugin_delegate.Pass()); | 1911 this, kBrowserPluginMimeType, GURL(params.url)); |
1919 } | 1912 } |
1920 | 1913 |
1921 #if defined(ENABLE_PLUGINS) | 1914 #if defined(ENABLE_PLUGINS) |
1922 WebPluginInfo info; | 1915 WebPluginInfo info; |
1923 std::string mime_type; | 1916 std::string mime_type; |
1924 bool found = false; | 1917 bool found = false; |
1925 Send(new FrameHostMsg_GetPluginInfo( | 1918 Send(new FrameHostMsg_GetPluginInfo( |
1926 routing_id_, params.url, frame->top()->document().url(), | 1919 routing_id_, params.url, frame->top()->document().url(), |
1927 params.mimeType.utf8(), &found, &info, &mime_type)); | 1920 params.mimeType.utf8(), &found, &info, &mime_type)); |
1928 if (!found) | 1921 if (!found) |
(...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4913 #elif defined(ENABLE_BROWSER_CDMS) | 4906 #elif defined(ENABLE_BROWSER_CDMS) |
4914 cdm_manager_, | 4907 cdm_manager_, |
4915 #endif | 4908 #endif |
4916 this); | 4909 this); |
4917 } | 4910 } |
4918 | 4911 |
4919 return cdm_factory_; | 4912 return cdm_factory_; |
4920 } | 4913 } |
4921 | 4914 |
4922 } // namespace content | 4915 } // namespace content |
OLD | NEW |