OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2103 StartsWith(name, L"Delete", true)) | 2103 StartsWith(name, L"Delete", true)) |
2104 return; | 2104 return; |
2105 UserMetricsRecordAction(name); | 2105 UserMetricsRecordAction(name); |
2106 } | 2106 } |
2107 | 2107 |
2108 // webkit_glue::WebPluginPageDelegate ----------------------------------------- | 2108 // webkit_glue::WebPluginPageDelegate ----------------------------------------- |
2109 | 2109 |
2110 webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate( | 2110 webkit_glue::WebPluginDelegate* RenderView::CreatePluginDelegate( |
2111 const GURL& url, | 2111 const GURL& url, |
2112 const std::string& mime_type, | 2112 const std::string& mime_type, |
2113 const std::string& clsid, | |
2114 std::string* actual_mime_type) { | 2113 std::string* actual_mime_type) { |
2115 if (!PluginChannelHost::IsListening()) | 2114 if (!PluginChannelHost::IsListening()) |
2116 return NULL; | 2115 return NULL; |
2117 | 2116 |
2118 GURL policy_url; | 2117 GURL policy_url; |
2119 WebFrame* main_frame = webview()->GetMainFrame(); | 2118 WebFrame* main_frame = webview()->GetMainFrame(); |
2120 if (main_frame) | 2119 if (main_frame) |
2121 policy_url = main_frame->url(); | 2120 policy_url = main_frame->url(); |
2122 | 2121 |
2123 FilePath path; | 2122 FilePath path; |
2124 render_thread_->Send( | 2123 render_thread_->Send(new ViewHostMsg_GetPluginPath( |
2125 new ViewHostMsg_GetPluginPath(url, policy_url, mime_type, clsid, &path, | 2124 url, policy_url, mime_type, &path, actual_mime_type)); |
2126 actual_mime_type)); | |
2127 if (path.value().empty()) | 2125 if (path.value().empty()) |
2128 return NULL; | 2126 return NULL; |
2129 | 2127 |
2130 const std::string* mime_type_to_use; | 2128 const std::string* mime_type_to_use; |
2131 if (!actual_mime_type->empty()) | 2129 if (!actual_mime_type->empty()) |
2132 mime_type_to_use = actual_mime_type; | 2130 mime_type_to_use = actual_mime_type; |
2133 else | 2131 else |
2134 mime_type_to_use = &mime_type; | 2132 mime_type_to_use = &mime_type; |
2135 | 2133 |
2136 if (RenderProcess::current()->in_process_plugins()) { | 2134 if (RenderProcess::current()->in_process_plugins()) { |
2137 #if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac. | 2135 #if defined(OS_WIN) // In-proc plugins aren't supported on Linux or Mac. |
2138 return WebPluginDelegateImpl::Create( | 2136 return WebPluginDelegateImpl::Create( |
2139 path, *mime_type_to_use, gfx::NativeViewFromId(host_window_)); | 2137 path, *mime_type_to_use, gfx::NativeViewFromId(host_window_)); |
2140 #else | 2138 #else |
2141 NOTIMPLEMENTED(); | 2139 NOTIMPLEMENTED(); |
2142 return NULL; | 2140 return NULL; |
2143 #endif | 2141 #endif |
2144 } | 2142 } |
2145 | 2143 |
2146 return new WebPluginDelegateProxy(*mime_type_to_use, clsid, AsWeakPtr()); | 2144 return new WebPluginDelegateProxy(*mime_type_to_use, AsWeakPtr()); |
2147 } | 2145 } |
2148 | 2146 |
2149 void RenderView::CreatedPluginWindow(gfx::PluginWindowHandle window) { | 2147 void RenderView::CreatedPluginWindow(gfx::PluginWindowHandle window) { |
2150 #if defined(OS_LINUX) | 2148 #if defined(OS_LINUX) |
2151 RenderThread::current()->Send(new ViewHostMsg_CreatePluginContainer( | 2149 RenderThread::current()->Send(new ViewHostMsg_CreatePluginContainer( |
2152 routing_id(), window)); | 2150 routing_id(), window)); |
2153 #endif | 2151 #endif |
2154 } | 2152 } |
2155 | 2153 |
2156 void RenderView::WillDestroyPluginWindow(gfx::PluginWindowHandle window) { | 2154 void RenderView::WillDestroyPluginWindow(gfx::PluginWindowHandle window) { |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3379 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); | 3377 Send(new ViewHostMsg_PasswordFormsSeen(routing_id_, password_forms)); |
3380 } | 3378 } |
3381 | 3379 |
3382 void RenderView::Print(WebFrame* frame, bool script_initiated) { | 3380 void RenderView::Print(WebFrame* frame, bool script_initiated) { |
3383 DCHECK(frame); | 3381 DCHECK(frame); |
3384 if (print_helper_.get() == NULL) { | 3382 if (print_helper_.get() == NULL) { |
3385 print_helper_.reset(new PrintWebViewHelper(this)); | 3383 print_helper_.reset(new PrintWebViewHelper(this)); |
3386 } | 3384 } |
3387 print_helper_->Print(frame, script_initiated); | 3385 print_helper_->Print(frame, script_initiated); |
3388 } | 3386 } |
OLD | NEW |