OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "content/public/common/content_constants.h" | 48 #include "content/public/common/content_constants.h" |
49 #include "content/public/common/content_switches.h" | 49 #include "content/public/common/content_switches.h" |
50 #include "content/public/common/context_menu_params.h" | 50 #include "content/public/common/context_menu_params.h" |
51 #include "content/public/common/file_chooser_params.h" | 51 #include "content/public/common/file_chooser_params.h" |
52 #include "content/public/common/url_constants.h" | 52 #include "content/public/common/url_constants.h" |
53 #include "content/public/renderer/content_renderer_client.h" | 53 #include "content/public/renderer/content_renderer_client.h" |
54 #include "content/public/renderer/document_state.h" | 54 #include "content/public/renderer/document_state.h" |
55 #include "content/public/renderer/navigation_state.h" | 55 #include "content/public/renderer/navigation_state.h" |
56 #include "content/public/renderer/render_view_observer.h" | 56 #include "content/public/renderer/render_view_observer.h" |
57 #include "content/public/renderer/render_view_visitor.h" | 57 #include "content/public/renderer/render_view_visitor.h" |
| 58 #include "content/renderer/browser_plugin/browser_plugin.h" |
| 59 #include "content/renderer/browser_plugin/browser_plugin_manager.h" |
58 #include "content/renderer/browser_plugin/old/old_browser_plugin.h" | 60 #include "content/renderer/browser_plugin/old/old_browser_plugin.h" |
59 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" | 61 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" |
60 #include "content/renderer/browser_plugin/old/browser_plugin_constants.h" | 62 #include "content/renderer/browser_plugin/old/browser_plugin_constants.h" |
61 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" | 63 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" |
62 #include "content/renderer/device_orientation_dispatcher.h" | 64 #include "content/renderer/device_orientation_dispatcher.h" |
63 #include "content/renderer/devtools_agent.h" | 65 #include "content/renderer/devtools_agent.h" |
64 #include "content/renderer/dom_automation_controller.h" | 66 #include "content/renderer/dom_automation_controller.h" |
65 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" | 67 #include "content/renderer/dom_storage/webstoragenamespace_impl.h" |
66 #include "content/renderer/external_popup_menu.h" | 68 #include "content/renderer/external_popup_menu.h" |
67 #include "content/renderer/geolocation_dispatcher.h" | 69 #include "content/renderer/geolocation_dispatcher.h" |
(...skipping 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 // WebKit::WebFrameClient ----------------------------------------------------- | 2312 // WebKit::WebFrameClient ----------------------------------------------------- |
2311 | 2313 |
2312 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, | 2314 WebPlugin* RenderViewImpl::createPlugin(WebFrame* frame, |
2313 const WebPluginParams& params) { | 2315 const WebPluginParams& params) { |
2314 WebPlugin* plugin = NULL; | 2316 WebPlugin* plugin = NULL; |
2315 if (content::GetContentClient()->renderer()->OverrideCreatePlugin( | 2317 if (content::GetContentClient()->renderer()->OverrideCreatePlugin( |
2316 this, frame, params, &plugin)) { | 2318 this, frame, params, &plugin)) { |
2317 return plugin; | 2319 return plugin; |
2318 } | 2320 } |
2319 | 2321 |
| 2322 // TODO(fsamuel): Remove this once upstreaming of the new browser plugin is |
| 2323 // complete. |
| 2324 if (UTF16ToASCII(params.mimeType) == content::kBrowserPluginNewMimeType) { |
| 2325 return content::BrowserPluginManager::Get()-> |
| 2326 CreateBrowserPlugin(this, frame, params); |
| 2327 } |
| 2328 |
2320 if (UTF16ToASCII(params.mimeType) == content::kBrowserPluginMimeType) | 2329 if (UTF16ToASCII(params.mimeType) == content::kBrowserPluginMimeType) |
2321 return content::old::BrowserPlugin::Create(this, frame, params); | 2330 return content::old::BrowserPlugin::Create(this, frame, params); |
2322 | 2331 |
2323 webkit::WebPluginInfo info; | 2332 webkit::WebPluginInfo info; |
2324 std::string mime_type; | 2333 std::string mime_type; |
2325 bool found = GetPluginInfo(params.url, frame->top()->document().url(), | 2334 bool found = GetPluginInfo(params.url, frame->top()->document().url(), |
2326 params.mimeType.utf8(), &info, &mime_type); | 2335 params.mimeType.utf8(), &info, &mime_type); |
2327 if (!found) | 2336 if (!found) |
2328 return NULL; | 2337 return NULL; |
2329 | 2338 |
(...skipping 3445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5775 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5784 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5776 return !!RenderThreadImpl::current()->compositor_thread(); | 5785 return !!RenderThreadImpl::current()->compositor_thread(); |
5777 } | 5786 } |
5778 | 5787 |
5779 void RenderViewImpl::OnJavaBridgeInit() { | 5788 void RenderViewImpl::OnJavaBridgeInit() { |
5780 DCHECK(!java_bridge_dispatcher_); | 5789 DCHECK(!java_bridge_dispatcher_); |
5781 #if defined(ENABLE_JAVA_BRIDGE) | 5790 #if defined(ENABLE_JAVA_BRIDGE) |
5782 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5791 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5783 #endif | 5792 #endif |
5784 } | 5793 } |
OLD | NEW |