| 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/npapi/webplugin_delegate_proxy.h" | 5 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #elif defined(USE_X11) | 9 #elif defined(USE_X11) |
| 10 #include <cairo/cairo.h> | 10 #include <cairo/cairo.h> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/version.h" | 26 #include "base/version.h" |
| 27 #include "content/child/child_process.h" | 27 #include "content/child/child_process.h" |
| 28 #include "content/child/npapi/npobject_proxy.h" | 28 #include "content/child/npapi/npobject_proxy.h" |
| 29 #include "content/child/npapi/npobject_stub.h" | 29 #include "content/child/npapi/npobject_stub.h" |
| 30 #include "content/child/npapi/npobject_util.h" | 30 #include "content/child/npapi/npobject_util.h" |
| 31 #include "content/child/npapi/webplugin_resource_client.h" | 31 #include "content/child/npapi/webplugin_resource_client.h" |
| 32 #include "content/child/plugin_messages.h" | 32 #include "content/child/plugin_messages.h" |
| 33 #include "content/common/content_constants_internal.h" | 33 #include "content/common/content_constants_internal.h" |
| 34 #include "content/common/frame_messages.h" |
| 34 #include "content/common/view_messages.h" | 35 #include "content/common/view_messages.h" |
| 35 #include "content/public/renderer/content_renderer_client.h" | 36 #include "content/public/renderer/content_renderer_client.h" |
| 36 #include "content/renderer/npapi/plugin_channel_host.h" | 37 #include "content/renderer/npapi/plugin_channel_host.h" |
| 37 #include "content/renderer/npapi/webplugin_impl.h" | 38 #include "content/renderer/npapi/webplugin_impl.h" |
| 38 #include "content/renderer/render_thread_impl.h" | 39 #include "content/renderer/render_thread_impl.h" |
| 39 #include "content/renderer/render_view_impl.h" | 40 #include "content/renderer/render_view_impl.h" |
| 40 #include "content/renderer/sad_plugin.h" | 41 #include "content/renderer/sad_plugin.h" |
| 41 #include "ipc/ipc_channel_handle.h" | 42 #include "ipc/ipc_channel_handle.h" |
| 42 #include "net/base/mime_util.h" | 43 #include "net/base/mime_util.h" |
| 43 #include "skia/ext/platform_canvas.h" | 44 #include "skia/ext/platform_canvas.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 // Set to true if the response expected is a multibyte response. | 196 // Set to true if the response expected is a multibyte response. |
| 196 // For e.g. response for a HTTP byte range request. | 197 // For e.g. response for a HTTP byte range request. |
| 197 bool multibyte_response_expected_; | 198 bool multibyte_response_expected_; |
| 198 }; | 199 }; |
| 199 | 200 |
| 200 } // namespace | 201 } // namespace |
| 201 | 202 |
| 202 WebPluginDelegateProxy::WebPluginDelegateProxy( | 203 WebPluginDelegateProxy::WebPluginDelegateProxy( |
| 203 WebPluginImpl* plugin, | 204 WebPluginImpl* plugin, |
| 204 const std::string& mime_type, | 205 const std::string& mime_type, |
| 205 const base::WeakPtr<RenderViewImpl>& render_view) | 206 const base::WeakPtr<RenderViewImpl>& render_view, |
| 207 RenderFrameImpl* render_frame) |
| 206 : render_view_(render_view), | 208 : render_view_(render_view), |
| 209 render_frame_(render_frame), |
| 207 plugin_(plugin), | 210 plugin_(plugin), |
| 208 uses_shared_bitmaps_(false), | 211 uses_shared_bitmaps_(false), |
| 209 #if defined(OS_MACOSX) | 212 #if defined(OS_MACOSX) |
| 210 uses_compositor_(false), | 213 uses_compositor_(false), |
| 211 #elif defined(OS_WIN) | 214 #elif defined(OS_WIN) |
| 212 dummy_activation_window_(NULL), | 215 dummy_activation_window_(NULL), |
| 213 #endif | 216 #endif |
| 214 window_(gfx::kNullPluginWindow), | 217 window_(gfx::kNullPluginWindow), |
| 215 mime_type_(mime_type), | 218 mime_type_(mime_type), |
| 216 instance_id_(MSG_ROUTING_NONE), | 219 instance_id_(MSG_ROUTING_NONE), |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 for (size_t attempt = 0; !result && attempt < kAttempts; attempt++) { | 301 for (size_t attempt = 0; !result && attempt < kAttempts; attempt++) { |
| 299 #if defined(OS_MACOSX) | 302 #if defined(OS_MACOSX) |
| 300 // TODO(shess): Debugging for http://crbug.com/97285 . See comment | 303 // TODO(shess): Debugging for http://crbug.com/97285 . See comment |
| 301 // in plugin_channel_host.cc. | 304 // in plugin_channel_host.cc. |
| 302 scoped_ptr<base::AutoReset<bool> > track_nested_removes( | 305 scoped_ptr<base::AutoReset<bool> > track_nested_removes( |
| 303 new base::AutoReset<bool>(PluginChannelHost::GetRemoveTrackingFlag(), | 306 new base::AutoReset<bool>(PluginChannelHost::GetRemoveTrackingFlag(), |
| 304 true)); | 307 true)); |
| 305 #endif | 308 #endif |
| 306 | 309 |
| 307 IPC::ChannelHandle channel_handle; | 310 IPC::ChannelHandle channel_handle; |
| 308 if (!RenderThreadImpl::current()->Send(new ViewHostMsg_OpenChannelToPlugin( | 311 if (!RenderThreadImpl::current()->Send(new FrameHostMsg_OpenChannelToPlugin( |
| 309 render_view_->routing_id(), url, page_url_, mime_type_, | 312 render_frame_->GetRoutingID(), url, page_url_, mime_type_, |
| 310 &channel_handle, &info_))) { | 313 &channel_handle, &info_))) { |
| 311 continue; | 314 continue; |
| 312 } | 315 } |
| 313 | 316 |
| 314 if (channel_handle.name.empty()) { | 317 if (channel_handle.name.empty()) { |
| 315 // We got an invalid handle. Either the plugin couldn't be found (which | 318 // We got an invalid handle. Either the plugin couldn't be found (which |
| 316 // shouldn't happen, since if we got here the plugin should exist) or the | 319 // shouldn't happen, since if we got here the plugin should exist) or the |
| 317 // plugin crashed on initialization. | 320 // plugin crashed on initialization. |
| 318 if (!info_.path.empty()) { | 321 if (!info_.path.empty()) { |
| 319 render_view_->main_render_frame()->PluginCrashed( | 322 render_view_->main_render_frame()->PluginCrashed( |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 | 1239 |
| 1237 plugin_->URLRedirectResponse(allow, resource_id); | 1240 plugin_->URLRedirectResponse(allow, resource_id); |
| 1238 } | 1241 } |
| 1239 | 1242 |
| 1240 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, | 1243 void WebPluginDelegateProxy::OnCheckIfRunInsecureContent(const GURL& url, |
| 1241 bool* result) { | 1244 bool* result) { |
| 1242 *result = plugin_->CheckIfRunInsecureContent(url); | 1245 *result = plugin_->CheckIfRunInsecureContent(url); |
| 1243 } | 1246 } |
| 1244 | 1247 |
| 1245 } // namespace content | 1248 } // namespace content |
| OLD | NEW |