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 <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 66 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
67 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserComplet
ion.h" | 67 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserComplet
ion.h" |
68 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" | 68 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" |
69 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 69 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
70 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 70 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
71 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 71 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
74 #include "ui/gfx/size.h" | 74 #include "ui/gfx/size.h" |
75 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 75 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 76 #include "webkit/plugins/plugin_constants.h" |
76 #include "webkit/plugins/npapi/webplugin.h" | 77 #include "webkit/plugins/npapi/webplugin.h" |
77 #include "webkit/plugins/ppapi/file_path.h" | 78 #include "webkit/plugins/ppapi/file_path.h" |
78 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 79 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
79 #include "webkit/plugins/ppapi/plugin_module.h" | 80 #include "webkit/plugins/ppapi/plugin_module.h" |
80 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 81 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
81 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 82 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
82 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" | 83 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" |
83 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 84 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
84 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 85 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
85 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" | 86 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 plugin_process_handle, | 248 plugin_process_handle, |
248 channel_handle, | 249 channel_handle, |
249 module->pp_module(), | 250 module->pp_module(), |
250 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), | 251 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
251 GetPreferences())) | 252 GetPreferences())) |
252 return scoped_refptr<webkit::ppapi::PluginModule>(); | 253 return scoped_refptr<webkit::ppapi::PluginModule>(); |
253 module->InitAsProxied(dispatcher.release()); | 254 module->InitAsProxied(dispatcher.release()); |
254 return module; | 255 return module; |
255 } | 256 } |
256 | 257 |
| 258 scoped_refptr<webkit::ppapi::PluginModule> |
| 259 PepperPluginDelegateImpl::CreateBrowserPluginModule( |
| 260 base::ProcessHandle process_handle, |
| 261 const IPC::ChannelHandle& channel_handle) { |
| 262 // Create a new HostDispatcher for the proxying, and hook it to a new |
| 263 // PluginModule. Note that AddLiveModule must be called before any early |
| 264 // returns since the module's destructor will remove itself. |
| 265 scoped_refptr<webkit::ppapi::PluginModule> module = |
| 266 new webkit::ppapi::PluginModule(kBrowserPluginName, |
| 267 FilePath(kBrowserPluginPath), |
| 268 NULL /* lifetime delegate */); |
| 269 |
| 270 scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper); |
| 271 if (!dispatcher->Init( |
| 272 process_handle, |
| 273 channel_handle, |
| 274 module->pp_module(), |
| 275 webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), |
| 276 GetPreferences())) |
| 277 return scoped_refptr<webkit::ppapi::PluginModule>(); |
| 278 module->InitAsProxied(dispatcher.release()); |
| 279 return module; |
| 280 } |
| 281 |
257 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( | 282 scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( |
258 webkit::ppapi::PluginModule* plugin_module) { | 283 webkit::ppapi::PluginModule* plugin_module) { |
259 DCHECK(plugin_module); | 284 DCHECK(plugin_module); |
260 DCHECK(!plugin_module->GetBroker()); | 285 DCHECK(!plugin_module->GetBroker()); |
261 | 286 |
262 // The broker path is the same as the plugin. | 287 // The broker path is the same as the plugin. |
263 const FilePath& broker_path = plugin_module->path(); | 288 const FilePath& broker_path = plugin_module->path(); |
264 | 289 |
265 scoped_refptr<PepperBrokerImpl> broker = | 290 scoped_refptr<PepperBrokerImpl> broker = |
266 new PepperBrokerImpl(plugin_module, this); | 291 new PepperBrokerImpl(plugin_module, this); |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); | 1581 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); |
1557 delete target; | 1582 delete target; |
1558 mouse_lock_instances_.erase(it); | 1583 mouse_lock_instances_.erase(it); |
1559 } | 1584 } |
1560 } | 1585 } |
1561 | 1586 |
1562 webkit_glue::ClipboardClient* | 1587 webkit_glue::ClipboardClient* |
1563 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1588 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1564 return new RendererClipboardClient; | 1589 return new RendererClipboardClient; |
1565 } | 1590 } |
OLD | NEW |