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 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 bool found = GetPluginInfo(params.url, frame->top()->document().url(), | 2128 bool found = GetPluginInfo(params.url, frame->top()->document().url(), |
2129 params.mimeType.utf8(), &info, &mime_type); | 2129 params.mimeType.utf8(), &info, &mime_type); |
2130 if (!found) | 2130 if (!found) |
2131 return NULL; | 2131 return NULL; |
2132 | 2132 |
2133 WebPluginParams params_to_use = params; | 2133 WebPluginParams params_to_use = params; |
2134 params_to_use.mimeType = WebString::fromUTF8(mime_type); | 2134 params_to_use.mimeType = WebString::fromUTF8(mime_type); |
2135 return CreatePlugin(frame, info, params_to_use); | 2135 return CreatePlugin(frame, info, params_to_use); |
2136 } | 2136 } |
2137 | 2137 |
2138 WebPlugin* RenderViewImpl::createPluginReplacement( | |
2139 WebFrame* frame, | |
2140 const WebPluginParams& params) { | |
2141 webkit::WebPluginInfo info; | |
2142 std::string mime_type; | |
2143 GetPluginInfo(params.url, frame->top()->document().url(), | |
2144 params.mimeType.utf8(), &info, &mime_type); | |
2145 return content::GetContentClient()->renderer()->CreatePluginReplacement( | |
2146 this, info.path); | |
2147 } | |
2148 | |
2149 WebSharedWorker* RenderViewImpl::createSharedWorker( | 2138 WebSharedWorker* RenderViewImpl::createSharedWorker( |
2150 WebFrame* frame, const WebURL& url, const WebString& name, | 2139 WebFrame* frame, const WebURL& url, const WebString& name, |
2151 unsigned long long document_id) { | 2140 unsigned long long document_id) { |
2152 | 2141 |
2153 int route_id = MSG_ROUTING_NONE; | 2142 int route_id = MSG_ROUTING_NONE; |
2154 bool exists = false; | 2143 bool exists = false; |
2155 bool url_mismatch = false; | 2144 bool url_mismatch = false; |
2156 ViewHostMsg_CreateWorker_Params params; | 2145 ViewHostMsg_CreateWorker_Params params; |
2157 params.url = url; | 2146 params.url = url; |
2158 params.name = name; | 2147 params.name = name; |
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3675 #else | 3664 #else |
3676 // In-proc plugins aren't supported on non-Windows. | 3665 // In-proc plugins aren't supported on non-Windows. |
3677 NOTIMPLEMENTED(); | 3666 NOTIMPLEMENTED(); |
3678 return NULL; | 3667 return NULL; |
3679 #endif | 3668 #endif |
3680 } | 3669 } |
3681 | 3670 |
3682 return new WebPluginDelegateProxy(mime_type, AsWeakPtr()); | 3671 return new WebPluginDelegateProxy(mime_type, AsWeakPtr()); |
3683 } | 3672 } |
3684 | 3673 |
3685 WebKit::WebPlugin* RenderViewImpl::CreatePluginReplacement( | |
3686 const FilePath& file_path) { | |
3687 return content::GetContentClient()->renderer()->CreatePluginReplacement( | |
3688 this, file_path); | |
3689 } | |
3690 | |
3691 void RenderViewImpl::CreatedPluginWindow(gfx::PluginWindowHandle window) { | 3674 void RenderViewImpl::CreatedPluginWindow(gfx::PluginWindowHandle window) { |
3692 #if defined(USE_X11) | 3675 #if defined(USE_X11) |
3693 Send(new ViewHostMsg_CreatePluginContainer(routing_id(), window)); | 3676 Send(new ViewHostMsg_CreatePluginContainer(routing_id(), window)); |
3694 #endif | 3677 #endif |
3695 } | 3678 } |
3696 | 3679 |
3697 void RenderViewImpl::WillDestroyPluginWindow(gfx::PluginWindowHandle window) { | 3680 void RenderViewImpl::WillDestroyPluginWindow(gfx::PluginWindowHandle window) { |
3698 #if defined(USE_X11) | 3681 #if defined(USE_X11) |
3699 Send(new ViewHostMsg_DestroyPluginContainer(routing_id(), window)); | 3682 Send(new ViewHostMsg_DestroyPluginContainer(routing_id(), window)); |
3700 #endif | 3683 #endif |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5274 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5257 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5275 return !!RenderThreadImpl::current()->compositor_thread(); | 5258 return !!RenderThreadImpl::current()->compositor_thread(); |
5276 } | 5259 } |
5277 | 5260 |
5278 void RenderViewImpl::OnJavaBridgeInit() { | 5261 void RenderViewImpl::OnJavaBridgeInit() { |
5279 DCHECK(!java_bridge_dispatcher_.get()); | 5262 DCHECK(!java_bridge_dispatcher_.get()); |
5280 #if defined(ENABLE_JAVA_BRIDGE) | 5263 #if defined(ENABLE_JAVA_BRIDGE) |
5281 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 5264 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
5282 #endif | 5265 #endif |
5283 } | 5266 } |
OLD | NEW |