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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10093011: Show a replacement plug-in for loading errors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 7 months 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
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/shell/shell_content_renderer_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
2138 WebSharedWorker* RenderViewImpl::createSharedWorker( 2149 WebSharedWorker* RenderViewImpl::createSharedWorker(
2139 WebFrame* frame, const WebURL& url, const WebString& name, 2150 WebFrame* frame, const WebURL& url, const WebString& name,
2140 unsigned long long document_id) { 2151 unsigned long long document_id) {
2141 2152
2142 int route_id = MSG_ROUTING_NONE; 2153 int route_id = MSG_ROUTING_NONE;
2143 bool exists = false; 2154 bool exists = false;
2144 bool url_mismatch = false; 2155 bool url_mismatch = false;
2145 ViewHostMsg_CreateWorker_Params params; 2156 ViewHostMsg_CreateWorker_Params params;
2146 params.url = url; 2157 params.url = url;
2147 params.name = name; 2158 params.name = name;
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
3664 #else 3675 #else
3665 // In-proc plugins aren't supported on non-Windows. 3676 // In-proc plugins aren't supported on non-Windows.
3666 NOTIMPLEMENTED(); 3677 NOTIMPLEMENTED();
3667 return NULL; 3678 return NULL;
3668 #endif 3679 #endif
3669 } 3680 }
3670 3681
3671 return new WebPluginDelegateProxy(mime_type, AsWeakPtr()); 3682 return new WebPluginDelegateProxy(mime_type, AsWeakPtr());
3672 } 3683 }
3673 3684
3685 WebKit::WebPlugin* RenderViewImpl::CreatePluginReplacement(
3686 const FilePath& file_path) {
3687 return content::GetContentClient()->renderer()->CreatePluginReplacement(
3688 this, file_path);
3689 }
3690
3674 void RenderViewImpl::CreatedPluginWindow(gfx::PluginWindowHandle window) { 3691 void RenderViewImpl::CreatedPluginWindow(gfx::PluginWindowHandle window) {
3675 #if defined(USE_X11) 3692 #if defined(USE_X11)
3676 Send(new ViewHostMsg_CreatePluginContainer(routing_id(), window)); 3693 Send(new ViewHostMsg_CreatePluginContainer(routing_id(), window));
3677 #endif 3694 #endif
3678 } 3695 }
3679 3696
3680 void RenderViewImpl::WillDestroyPluginWindow(gfx::PluginWindowHandle window) { 3697 void RenderViewImpl::WillDestroyPluginWindow(gfx::PluginWindowHandle window) {
3681 #if defined(USE_X11) 3698 #if defined(USE_X11)
3682 Send(new ViewHostMsg_DestroyPluginContainer(routing_id(), window)); 3699 Send(new ViewHostMsg_DestroyPluginContainer(routing_id(), window));
3683 #endif 3700 #endif
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
5257 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5274 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5258 return !!RenderThreadImpl::current()->compositor_thread(); 5275 return !!RenderThreadImpl::current()->compositor_thread();
5259 } 5276 }
5260 5277
5261 void RenderViewImpl::OnJavaBridgeInit() { 5278 void RenderViewImpl::OnJavaBridgeInit() {
5262 DCHECK(!java_bridge_dispatcher_.get()); 5279 DCHECK(!java_bridge_dispatcher_.get());
5263 #if defined(ENABLE_JAVA_BRIDGE) 5280 #if defined(ENABLE_JAVA_BRIDGE)
5264 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 5281 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
5265 #endif 5282 #endif
5266 } 5283 }
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/shell/shell_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698