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_impl.h" | 5 #include "content/renderer/npapi/webplugin_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "cc/layers/io_surface_layer.h" | 16 #include "cc/layers/io_surface_layer.h" |
17 #include "content/child/appcache/web_application_cache_host_impl.h" | 17 #include "content/child/appcache/web_application_cache_host_impl.h" |
18 #include "content/child/npapi/plugin_host.h" | 18 #include "content/child/npapi/plugin_host.h" |
19 #include "content/child/npapi/plugin_instance.h" | 19 #include "content/child/npapi/plugin_instance.h" |
20 #include "content/child/npapi/webplugin_delegate_impl.h" | 20 #include "content/child/npapi/webplugin_delegate_impl.h" |
21 #include "content/child/npapi/webplugin_resource_client.h" | 21 #include "content/child/npapi/webplugin_resource_client.h" |
22 #include "content/common/view_messages.h" | 22 #include "content/common/view_messages.h" |
23 #include "content/public/common/content_constants.h" | 23 #include "content/public/common/content_constants.h" |
24 #include "content/public/common/content_switches.h" | 24 #include "content/public/common/content_switches.h" |
25 #include "content/public/renderer/content_renderer_client.h" | 25 #include "content/public/renderer/content_renderer_client.h" |
26 #include "content/renderer/npapi/webplugin_delegate_proxy.h" | 26 #include "content/renderer/npapi/webplugin_delegate_proxy.h" |
| 27 #include "content/renderer/render_frame_impl.h" |
27 #include "content/renderer/render_process.h" | 28 #include "content/renderer/render_process.h" |
28 #include "content/renderer/render_thread_impl.h" | 29 #include "content/renderer/render_thread_impl.h" |
29 #include "content/renderer/render_view_impl.h" | 30 #include "content/renderer/render_view_impl.h" |
30 #include "net/base/escape.h" | 31 #include "net/base/escape.h" |
31 #include "net/base/net_errors.h" | 32 #include "net/base/net_errors.h" |
32 #include "net/http/http_response_headers.h" | 33 #include "net/http/http_response_headers.h" |
33 #include "skia/ext/platform_canvas.h" | 34 #include "skia/ext/platform_canvas.h" |
34 #include "third_party/WebKit/public/platform/WebCString.h" | 35 #include "third_party/WebKit/public/platform/WebCString.h" |
35 #include "third_party/WebKit/public/platform/WebCookieJar.h" | 36 #include "third_party/WebKit/public/platform/WebCookieJar.h" |
36 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 37 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 return false; | 476 return false; |
476 } | 477 } |
477 | 478 |
478 // ----------------------------------------------------------------------------- | 479 // ----------------------------------------------------------------------------- |
479 | 480 |
480 WebPluginImpl::WebPluginImpl( | 481 WebPluginImpl::WebPluginImpl( |
481 WebFrame* webframe, | 482 WebFrame* webframe, |
482 const WebPluginParams& params, | 483 const WebPluginParams& params, |
483 const base::FilePath& file_path, | 484 const base::FilePath& file_path, |
484 const base::WeakPtr<RenderViewImpl>& render_view, | 485 const base::WeakPtr<RenderViewImpl>& render_view, |
485 RenderFrame* render_frame) | 486 RenderFrameImpl* render_frame) |
486 : windowless_(false), | 487 : windowless_(false), |
487 window_(gfx::kNullPluginWindow), | 488 window_(gfx::kNullPluginWindow), |
488 accepts_input_events_(false), | 489 accepts_input_events_(false), |
489 render_frame_(render_frame), | 490 render_frame_(render_frame), |
490 render_view_(render_view), | 491 render_view_(render_view), |
491 webframe_(webframe), | 492 webframe_(webframe), |
492 delegate_(NULL), | 493 delegate_(NULL), |
493 container_(NULL), | 494 container_(NULL), |
494 npp_(NULL), | 495 npp_(NULL), |
495 plugin_url_(params.url), | 496 plugin_url_(params.url), |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 if (in_process_plugin) { | 644 if (in_process_plugin) { |
644 #if defined(OS_WIN) && !defined(USE_AURA) | 645 #if defined(OS_WIN) && !defined(USE_AURA) |
645 return WebPluginDelegateImpl::Create(this, file_path_, mime_type_); | 646 return WebPluginDelegateImpl::Create(this, file_path_, mime_type_); |
646 #else | 647 #else |
647 // In-proc plugins aren't supported on non-Windows. | 648 // In-proc plugins aren't supported on non-Windows. |
648 NOTIMPLEMENTED(); | 649 NOTIMPLEMENTED(); |
649 return NULL; | 650 return NULL; |
650 #endif | 651 #endif |
651 } | 652 } |
652 | 653 |
653 return new WebPluginDelegateProxy(this, mime_type_, render_view_); | 654 return new WebPluginDelegateProxy( |
| 655 this, mime_type_, render_view_, render_frame_); |
654 } | 656 } |
655 | 657 |
656 WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame( | 658 WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame( |
657 const char* url, | 659 const char* url, |
658 bool is_javascript_url, | 660 bool is_javascript_url, |
659 bool popups_allowed, | 661 bool popups_allowed, |
660 const char* method, | 662 const char* method, |
661 const char* target, | 663 const char* target, |
662 const char* buf, | 664 const char* buf, |
663 unsigned int len, | 665 unsigned int len, |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 case PLUGIN_SRC: | 1502 case PLUGIN_SRC: |
1501 webframe_->setReferrerForRequest(*request, plugin_url_); | 1503 webframe_->setReferrerForRequest(*request, plugin_url_); |
1502 break; | 1504 break; |
1503 | 1505 |
1504 default: | 1506 default: |
1505 break; | 1507 break; |
1506 } | 1508 } |
1507 } | 1509 } |
1508 | 1510 |
1509 } // namespace content | 1511 } // namespace content |
OLD | NEW |