| 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/plugin/webplugin_proxy.h" | 5 #include "content/plugin/webplugin_proxy.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/memory/scoped_handle.h" | 11 #include "base/memory/scoped_handle.h" |
| 12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "content/child/npapi/webplugin_delegate_impl.h" |
| 14 #include "content/child/npobject_proxy.h" | 15 #include "content/child/npobject_proxy.h" |
| 15 #include "content/child/npobject_util.h" | 16 #include "content/child/npobject_util.h" |
| 16 #include "content/child/plugin_messages.h" | 17 #include "content/child/plugin_messages.h" |
| 17 #include "content/plugin/plugin_channel.h" | 18 #include "content/plugin/plugin_channel.h" |
| 18 #include "content/plugin/plugin_thread.h" | 19 #include "content/plugin/plugin_thread.h" |
| 19 #include "content/public/common/content_client.h" | 20 #include "content/public/common/content_client.h" |
| 20 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
| 21 #include "skia/ext/platform_canvas.h" | 22 #include "skia/ext/platform_canvas.h" |
| 22 #include "skia/ext/platform_device.h" | 23 #include "skia/ext/platform_device.h" |
| 23 #include "third_party/WebKit/public/web/WebBindings.h" | 24 #include "third_party/WebKit/public/web/WebBindings.h" |
| 24 #include "ui/gfx/blit.h" | 25 #include "ui/gfx/blit.h" |
| 25 #include "ui/gfx/canvas.h" | 26 #include "ui/gfx/canvas.h" |
| 26 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | |
| 27 | 27 |
| 28 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
| 29 #include "base/mac/mac_util.h" | 29 #include "base/mac/mac_util.h" |
| 30 #include "base/mac/scoped_cftyperef.h" | 30 #include "base/mac/scoped_cftyperef.h" |
| 31 #include "content/plugin/webplugin_accelerated_surface_proxy_mac.h" | 31 #include "content/plugin/webplugin_accelerated_surface_proxy_mac.h" |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #if defined(USE_X11) | 34 #if defined(USE_X11) |
| 35 #include "ui/base/x/x11_util_internal.h" | 35 #include "ui/base/x/x11_util_internal.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
| 39 #include "content/common/plugin_process_messages.h" | 39 #include "content/common/plugin_process_messages.h" |
| 40 #include "content/public/common/sandbox_init.h" | 40 #include "content/public/common/sandbox_init.h" |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 using WebKit::WebBindings; | 43 using WebKit::WebBindings; |
| 44 | 44 |
| 45 using webkit::npapi::WebPluginResourceClient; | |
| 46 #if defined(OS_MACOSX) | |
| 47 using webkit::npapi::WebPluginAcceleratedSurface; | |
| 48 #endif | |
| 49 | |
| 50 namespace content { | 45 namespace content { |
| 51 | 46 |
| 52 WebPluginProxy::SharedTransportDIB::SharedTransportDIB(TransportDIB* dib) | 47 WebPluginProxy::SharedTransportDIB::SharedTransportDIB(TransportDIB* dib) |
| 53 : dib_(dib) { | 48 : dib_(dib) { |
| 54 } | 49 } |
| 55 | 50 |
| 56 WebPluginProxy::SharedTransportDIB::~SharedTransportDIB() { | 51 WebPluginProxy::SharedTransportDIB::~SharedTransportDIB() { |
| 57 } | 52 } |
| 58 | 53 |
| 59 WebPluginProxy::WebPluginProxy( | 54 WebPluginProxy::WebPluginProxy( |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 const char* target, | 311 const char* target, |
| 317 const char* buf, | 312 const char* buf, |
| 318 unsigned int len, | 313 unsigned int len, |
| 319 int notify_id, | 314 int notify_id, |
| 320 bool popups_allowed, | 315 bool popups_allowed, |
| 321 bool notify_redirects) { | 316 bool notify_redirects) { |
| 322 if (!target && (0 == base::strcasecmp(method, "GET"))) { | 317 if (!target && (0 == base::strcasecmp(method, "GET"))) { |
| 323 // Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=366082 | 318 // Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=366082 |
| 324 // for more details on this. | 319 // for more details on this. |
| 325 if (delegate_->GetQuirks() & | 320 if (delegate_->GetQuirks() & |
| 326 webkit::npapi::WebPluginDelegateImpl:: | 321 WebPluginDelegateImpl::PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { |
| 327 PLUGIN_QUIRK_BLOCK_NONSTANDARD_GETURL_REQUESTS) { | |
| 328 GURL request_url(url); | 322 GURL request_url(url); |
| 329 if (!request_url.SchemeIs(chrome::kHttpScheme) && | 323 if (!request_url.SchemeIs(chrome::kHttpScheme) && |
| 330 !request_url.SchemeIs(chrome::kHttpsScheme) && | 324 !request_url.SchemeIs(chrome::kHttpsScheme) && |
| 331 !request_url.SchemeIs(chrome::kFtpScheme)) { | 325 !request_url.SchemeIs(chrome::kFtpScheme)) { |
| 332 return; | 326 return; |
| 333 } | 327 } |
| 334 } | 328 } |
| 335 } | 329 } |
| 336 | 330 |
| 337 PluginHostMsg_URLRequest_Params params; | 331 PluginHostMsg_URLRequest_Params params; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 int input_type; | 699 int input_type; |
| 706 gfx::Rect caret_rect; | 700 gfx::Rect caret_rect; |
| 707 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) | 701 if (!delegate_->GetIMEStatus(&input_type, &caret_rect)) |
| 708 return; | 702 return; |
| 709 | 703 |
| 710 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); | 704 Send(new PluginHostMsg_NotifyIMEStatus(route_id_, input_type, caret_rect)); |
| 711 } | 705 } |
| 712 #endif | 706 #endif |
| 713 | 707 |
| 714 } // namespace content | 708 } // namespace content |
| OLD | NEW |