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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "content/public/renderer/render_view_observer.h" | 19 #include "content/public/renderer/render_view_observer.h" |
20 #include "content/renderer/mouse_lock_dispatcher.h" | 20 #include "content/renderer/mouse_lock_dispatcher.h" |
21 #include "content/renderer/pepper/pepper_parent_context_provider.h" | 21 #include "content/renderer/pepper/pepper_parent_context_provider.h" |
| 22 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" |
22 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 23 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
23 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" | 24 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" |
24 #include "ui/base/ime/text_input_type.h" | 25 #include "ui/base/ime/text_input_type.h" |
25 #include "webkit/plugins/ppapi/plugin_delegate.h" | 26 #include "webkit/plugins/ppapi/plugin_delegate.h" |
26 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" | 27 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
27 | 28 |
28 class FilePath; | 29 class FilePath; |
29 class PepperBrokerImpl; | 30 class PepperBrokerImpl; |
30 class PepperPluginDelegateImpl; | 31 class PepperPluginDelegateImpl; |
31 class RenderViewImpl; | 32 class RenderViewImpl; |
32 | 33 |
33 namespace content { | 34 namespace content { |
34 class GamepadSharedMemoryReader; | 35 class GamepadSharedMemoryReader; |
35 struct CustomContextMenuContext; | 36 struct CustomContextMenuContext; |
36 } | 37 } |
37 | 38 |
38 namespace gfx { | 39 namespace gfx { |
39 class Point; | 40 class Point; |
40 class Rect; | 41 class Rect; |
41 } | 42 } |
42 | 43 |
43 namespace IPC { | 44 namespace IPC { |
44 struct ChannelHandle; | 45 struct ChannelHandle; |
45 } | 46 } |
46 | 47 |
| 48 namespace ppapi { |
| 49 class NetworkList; |
| 50 } |
| 51 |
47 namespace webkit { | 52 namespace webkit { |
48 struct WebPluginInfo; | 53 struct WebPluginInfo; |
49 namespace ppapi { | 54 namespace ppapi { |
50 class PepperFilePath; | 55 class PepperFilePath; |
51 class PluginInstance; | 56 class PluginInstance; |
52 class PluginModule; | 57 class PluginModule; |
53 } | 58 } |
54 } | 59 } |
55 | 60 |
56 namespace WebKit { | 61 namespace WebKit { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; | 297 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; |
293 virtual void TCPServerSocketListen( | 298 virtual void TCPServerSocketListen( |
294 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket, | 299 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket, |
295 uint32 temp_socket_id, | 300 uint32 temp_socket_id, |
296 const PP_NetAddress_Private& addr, | 301 const PP_NetAddress_Private& addr, |
297 int32_t backlog) OVERRIDE; | 302 int32_t backlog) OVERRIDE; |
298 virtual void TCPServerSocketAccept(uint32 real_socket_id) OVERRIDE; | 303 virtual void TCPServerSocketAccept(uint32 real_socket_id) OVERRIDE; |
299 virtual void TCPServerSocketStopListening(uint32 real_socket_id, | 304 virtual void TCPServerSocketStopListening(uint32 real_socket_id, |
300 uint32 temp_socket_id) OVERRIDE; | 305 uint32 temp_socket_id) OVERRIDE; |
301 | 306 |
| 307 virtual void RegisterHostResolver( |
| 308 ppapi::PPB_HostResolver_Shared* host_resolver, |
| 309 uint32 host_resolver_id) OVERRIDE; |
| 310 virtual void HostResolverResolve( |
| 311 uint32 host_resolver_id, |
| 312 const std::string& host, |
| 313 uint16_t port, |
| 314 const PP_HostResolver_Private_Hint* hint) OVERRIDE; |
| 315 virtual void UnregisterHostResolver(uint32 host_resolver_id) OVERRIDE; |
| 316 |
302 virtual int32_t ShowContextMenu( | 317 virtual int32_t ShowContextMenu( |
303 webkit::ppapi::PluginInstance* instance, | 318 webkit::ppapi::PluginInstance* instance, |
304 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 319 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
305 const gfx::Point& position) OVERRIDE; | 320 const gfx::Point& position) OVERRIDE; |
306 void OnContextMenuClosed( | 321 void OnContextMenuClosed( |
307 const content::CustomContextMenuContext& custom_context); | 322 const content::CustomContextMenuContext& custom_context); |
308 void OnCustomContextMenuAction( | 323 void OnCustomContextMenuAction( |
309 const content::CustomContextMenuContext& custom_context, | 324 const content::CustomContextMenuContext& custom_context, |
310 unsigned action); | 325 unsigned action); |
311 void CompleteShowContextMenu(int request_id, | 326 void CompleteShowContextMenu(int request_id, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 const PP_NetAddress_Private& addr); | 394 const PP_NetAddress_Private& addr); |
380 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, | 395 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, |
381 uint32 real_socket_id, | 396 uint32 real_socket_id, |
382 uint32 temp_socket_id, | 397 uint32 temp_socket_id, |
383 int32_t status); | 398 int32_t status); |
384 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, | 399 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, |
385 uint32 real_server_socket_id, | 400 uint32 real_server_socket_id, |
386 uint32 accepted_socket_id, | 401 uint32 accepted_socket_id, |
387 const PP_NetAddress_Private& local_addr, | 402 const PP_NetAddress_Private& local_addr, |
388 const PP_NetAddress_Private& remote_addr); | 403 const PP_NetAddress_Private& remote_addr); |
| 404 void OnHostResolverResolveACK(uint32 host_resolver_id, |
| 405 bool succeeded, |
| 406 const ppapi::NetworkList& network_list); |
389 | 407 |
390 CONTENT_EXPORT int GetRoutingId() const; | 408 CONTENT_EXPORT int GetRoutingId() const; |
391 | 409 |
392 typedef base::Callback<void (int /* request_id */, | 410 typedef base::Callback<void (int /* request_id */, |
393 bool /* succeeded */, | 411 bool /* succeeded */, |
394 const std::string& /* label */)> | 412 const std::string& /* label */)> |
395 OpenDeviceCallback; | 413 OpenDeviceCallback; |
396 | 414 |
397 // Opens the specified device. The request ID passed into the callback will be | 415 // Opens the specified device. The request ID passed into the callback will be |
398 // the same as the return value. If successful, the label passed into the | 416 // the same as the return value. If successful, the label passed into the |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 456 |
439 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; | 457 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; |
440 | 458 |
441 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; | 459 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; |
442 | 460 |
443 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> tcp_server_sockets_; | 461 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> tcp_server_sockets_; |
444 | 462 |
445 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> | 463 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> |
446 uninitialized_tcp_server_sockets_; | 464 uninitialized_tcp_server_sockets_; |
447 | 465 |
| 466 IDMap<ppapi::PPB_HostResolver_Shared> host_resolvers_; |
| 467 |
448 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, | 468 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
449 IDMapOwnPointer> pending_context_menus_; | 469 IDMapOwnPointer> pending_context_menus_; |
450 | 470 |
451 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; | 471 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; |
452 BrokerMap pending_connect_broker_; | 472 BrokerMap pending_connect_broker_; |
453 | 473 |
454 // Whether or not the focus is on a PPAPI plugin | 474 // Whether or not the focus is on a PPAPI plugin |
455 webkit::ppapi::PluginInstance* focused_plugin_; | 475 webkit::ppapi::PluginInstance* focused_plugin_; |
456 | 476 |
457 // Current text input composition text. Empty if no composition is in | 477 // Current text input composition text. Empty if no composition is in |
458 // progress. | 478 // progress. |
459 string16 composition_text_; | 479 string16 composition_text_; |
460 | 480 |
461 // The plugin instance that received the last mouse event. It is set to NULL | 481 // The plugin instance that received the last mouse event. It is set to NULL |
462 // if the last mouse event went to elements other than Pepper plugins. | 482 // if the last mouse event went to elements other than Pepper plugins. |
463 // |last_mouse_event_target_| is not owned by this class. We can know about | 483 // |last_mouse_event_target_| is not owned by this class. We can know about |
464 // when it is destroyed via InstanceDeleted(). | 484 // when it is destroyed via InstanceDeleted(). |
465 webkit::ppapi::PluginInstance* last_mouse_event_target_; | 485 webkit::ppapi::PluginInstance* last_mouse_event_target_; |
466 | 486 |
467 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 487 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
468 | 488 |
469 scoped_ptr<DeviceEnumerationEventHandler> device_enumeration_event_handler_; | 489 scoped_ptr<DeviceEnumerationEventHandler> device_enumeration_event_handler_; |
470 | 490 |
471 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 491 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
472 }; | 492 }; |
473 | 493 |
474 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 494 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |