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/pepper/pepper_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
82 #include "ui/gfx/size.h" | 82 #include "ui/gfx/size.h" |
83 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 83 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
84 #include "webkit/plugins/npapi/webplugin.h" | 84 #include "webkit/plugins/npapi/webplugin.h" |
85 #include "webkit/plugins/ppapi/plugin_module.h" | 85 #include "webkit/plugins/ppapi/plugin_module.h" |
86 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 86 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 87 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
87 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 88 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
88 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 89 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
89 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 90 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
90 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 91 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
91 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" | 92 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" |
92 #include "webkit/plugins/ppapi/resource_helper.h" | 93 #include "webkit/plugins/ppapi/resource_helper.h" |
93 #include "webkit/plugins/webplugininfo.h" | 94 #include "webkit/plugins/webplugininfo.h" |
94 | 95 |
95 using WebKit::WebView; | 96 using WebKit::WebView; |
96 using WebKit::WebFrame; | 97 using WebKit::WebFrame; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 focused_plugin_(NULL), | 330 focused_plugin_(NULL), |
330 last_mouse_event_target_(NULL), | 331 last_mouse_event_target_(NULL), |
331 device_enumeration_event_handler_( | 332 device_enumeration_event_handler_( |
332 new PepperDeviceEnumerationEventHandler()) { | 333 new PepperDeviceEnumerationEventHandler()) { |
333 } | 334 } |
334 | 335 |
335 PepperPluginDelegateImpl::~PepperPluginDelegateImpl() { | 336 PepperPluginDelegateImpl::~PepperPluginDelegateImpl() { |
336 DCHECK(mouse_lock_instances_.empty()); | 337 DCHECK(mouse_lock_instances_.empty()); |
337 } | 338 } |
338 | 339 |
| 340 WebKit::WebPlugin* PepperPluginDelegateImpl::CreatePepperWebPlugin( |
| 341 const webkit::WebPluginInfo& webplugin_info, |
| 342 const WebKit::WebPluginParams& params) { |
| 343 bool pepper_plugin_was_registered = false; |
| 344 scoped_refptr<webkit::ppapi::PluginModule> pepper_module( |
| 345 CreatePepperPluginModule(webplugin_info, &pepper_plugin_was_registered)); |
| 346 |
| 347 if (pepper_plugin_was_registered) { |
| 348 if (!pepper_module) |
| 349 return NULL; |
| 350 return new webkit::ppapi::WebPluginImpl( |
| 351 pepper_module.get(), params, AsWeakPtr()); |
| 352 } |
| 353 |
| 354 return NULL; |
| 355 } |
| 356 |
339 scoped_refptr<webkit::ppapi::PluginModule> | 357 scoped_refptr<webkit::ppapi::PluginModule> |
340 PepperPluginDelegateImpl::CreatePepperPluginModule( | 358 PepperPluginDelegateImpl::CreatePepperPluginModule( |
341 const webkit::WebPluginInfo& webplugin_info, | 359 const webkit::WebPluginInfo& webplugin_info, |
342 bool* pepper_plugin_was_registered) { | 360 bool* pepper_plugin_was_registered) { |
343 *pepper_plugin_was_registered = true; | 361 *pepper_plugin_was_registered = true; |
344 | 362 |
345 // See if a module has already been loaded for this plugin. | 363 // See if a module has already been loaded for this plugin. |
346 FilePath path(webplugin_info.path); | 364 FilePath path(webplugin_info.path); |
347 scoped_refptr<webkit::ppapi::PluginModule> module = | 365 scoped_refptr<webkit::ppapi::PluginModule> module = |
348 PepperPluginRegistry::GetInstance()->GetLiveModule(path); | 366 PepperPluginRegistry::GetInstance()->GetLiveModule(path); |
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1807 RenderWidgetFullscreenPepper* container = | 1825 RenderWidgetFullscreenPepper* container = |
1808 static_cast<RenderWidgetFullscreenPepper*>( | 1826 static_cast<RenderWidgetFullscreenPepper*>( |
1809 instance->fullscreen_container()); | 1827 instance->fullscreen_container()); |
1810 return container->mouse_lock_dispatcher(); | 1828 return container->mouse_lock_dispatcher(); |
1811 } else { | 1829 } else { |
1812 return render_view_->mouse_lock_dispatcher(); | 1830 return render_view_->mouse_lock_dispatcher(); |
1813 } | 1831 } |
1814 } | 1832 } |
1815 | 1833 |
1816 } // namespace content | 1834 } // namespace content |
OLD | NEW |