| 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 "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/public/renderer/render_view_observer.h" | 20 #include "content/public/renderer/render_view_observer.h" |
| 21 #include "content/renderer/mouse_lock_dispatcher.h" | 21 #include "content/renderer/mouse_lock_dispatcher.h" |
| 22 #include "content/renderer/pepper/pepper_parent_context_provider.h" | 22 #include "content/renderer/pepper/pepper_parent_context_provider.h" |
| 23 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" |
| 23 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 24 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |
| 24 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" | 25 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" |
| 25 #include "ui/base/ime/text_input_type.h" | 26 #include "ui/base/ime/text_input_type.h" |
| 26 #include "webkit/plugins/ppapi/plugin_delegate.h" | 27 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 27 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" | 28 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
| 28 | 29 |
| 29 class FilePath; | 30 class FilePath; |
| 30 class PepperBrokerImpl; | 31 class PepperBrokerImpl; |
| 31 class PepperDeviceEnumerationEventHandler; | 32 class PepperDeviceEnumerationEventHandler; |
| 32 class PepperPluginDelegateImpl; | 33 class PepperPluginDelegateImpl; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; | 295 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; |
| 295 virtual void TCPServerSocketListen( | 296 virtual void TCPServerSocketListen( |
| 296 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket, | 297 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket, |
| 297 uint32 temp_socket_id, | 298 uint32 temp_socket_id, |
| 298 const PP_NetAddress_Private& addr, | 299 const PP_NetAddress_Private& addr, |
| 299 int32_t backlog) OVERRIDE; | 300 int32_t backlog) OVERRIDE; |
| 300 virtual void TCPServerSocketAccept(uint32 real_socket_id) OVERRIDE; | 301 virtual void TCPServerSocketAccept(uint32 real_socket_id) OVERRIDE; |
| 301 virtual void TCPServerSocketStopListening(uint32 real_socket_id, | 302 virtual void TCPServerSocketStopListening(uint32 real_socket_id, |
| 302 uint32 temp_socket_id) OVERRIDE; | 303 uint32 temp_socket_id) OVERRIDE; |
| 303 | 304 |
| 305 virtual void RegisterHostResolver( |
| 306 ppapi::PPB_HostResolver_Shared* host_resolver, |
| 307 uint32 host_resolver_id) OVERRIDE; |
| 308 virtual void HostResolverResolve( |
| 309 uint32 host_resolver_id, |
| 310 const ::ppapi::HostPortPair& host_port, |
| 311 const PP_HostResolver_Private_Hint* hint) OVERRIDE; |
| 312 virtual void UnregisterHostResolver(uint32 host_resolver_id) OVERRIDE; |
| 313 |
| 304 virtual bool AddNetworkListObserver( | 314 virtual bool AddNetworkListObserver( |
| 305 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 315 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
| 306 virtual void RemoveNetworkListObserver( | 316 virtual void RemoveNetworkListObserver( |
| 307 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 317 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
| 308 | 318 |
| 309 virtual int32_t ShowContextMenu( | 319 virtual int32_t ShowContextMenu( |
| 310 webkit::ppapi::PluginInstance* instance, | 320 webkit::ppapi::PluginInstance* instance, |
| 311 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 321 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| 312 const gfx::Point& position) OVERRIDE; | 322 const gfx::Point& position) OVERRIDE; |
| 313 void OnContextMenuClosed( | 323 void OnContextMenuClosed( |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 const PP_NetAddress_Private& addr); | 396 const PP_NetAddress_Private& addr); |
| 387 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, | 397 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, |
| 388 uint32 real_socket_id, | 398 uint32 real_socket_id, |
| 389 uint32 temp_socket_id, | 399 uint32 temp_socket_id, |
| 390 int32_t status); | 400 int32_t status); |
| 391 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, | 401 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, |
| 392 uint32 real_server_socket_id, | 402 uint32 real_server_socket_id, |
| 393 uint32 accepted_socket_id, | 403 uint32 accepted_socket_id, |
| 394 const PP_NetAddress_Private& local_addr, | 404 const PP_NetAddress_Private& local_addr, |
| 395 const PP_NetAddress_Private& remote_addr); | 405 const PP_NetAddress_Private& remote_addr); |
| 406 void OnHostResolverResolveACK(uint32 plugin_dispatcher_id, |
| 407 uint32 host_resolver_id, |
| 408 bool succeeded, |
| 409 const std::string& canonical_name, |
| 410 const ppapi::NetAddressList& net_address_list); |
| 396 | 411 |
| 397 CONTENT_EXPORT int GetRoutingID() const; | 412 CONTENT_EXPORT int GetRoutingID() const; |
| 398 | 413 |
| 399 typedef base::Callback<void (int /* request_id */, | 414 typedef base::Callback<void (int /* request_id */, |
| 400 bool /* succeeded */, | 415 bool /* succeeded */, |
| 401 const std::string& /* label */)> | 416 const std::string& /* label */)> |
| 402 OpenDeviceCallback; | 417 OpenDeviceCallback; |
| 403 | 418 |
| 404 // Opens the specified device. The request ID passed into the callback will be | 419 // Opens the specified device. The request ID passed into the callback will be |
| 405 // the same as the return value. If successful, the label passed into the | 420 // the same as the return value. If successful, the label passed into the |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 | 458 |
| 444 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; | 459 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; |
| 445 | 460 |
| 446 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; | 461 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; |
| 447 | 462 |
| 448 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> tcp_server_sockets_; | 463 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> tcp_server_sockets_; |
| 449 | 464 |
| 450 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> | 465 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> |
| 451 uninitialized_tcp_server_sockets_; | 466 uninitialized_tcp_server_sockets_; |
| 452 | 467 |
| 468 IDMap<ppapi::PPB_HostResolver_Shared> host_resolvers_; |
| 469 |
| 453 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, | 470 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
| 454 IDMapOwnPointer> pending_context_menus_; | 471 IDMapOwnPointer> pending_context_menus_; |
| 455 | 472 |
| 456 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; | 473 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; |
| 457 BrokerMap pending_connect_broker_; | 474 BrokerMap pending_connect_broker_; |
| 458 | 475 |
| 459 // Whether or not the focus is on a PPAPI plugin | 476 // Whether or not the focus is on a PPAPI plugin |
| 460 webkit::ppapi::PluginInstance* focused_plugin_; | 477 webkit::ppapi::PluginInstance* focused_plugin_; |
| 461 | 478 |
| 462 // Current text input composition text. Empty if no composition is in | 479 // Current text input composition text. Empty if no composition is in |
| 463 // progress. | 480 // progress. |
| 464 string16 composition_text_; | 481 string16 composition_text_; |
| 465 | 482 |
| 466 // The plugin instance that received the last mouse event. It is set to NULL | 483 // The plugin instance that received the last mouse event. It is set to NULL |
| 467 // if the last mouse event went to elements other than Pepper plugins. | 484 // if the last mouse event went to elements other than Pepper plugins. |
| 468 // |last_mouse_event_target_| is not owned by this class. We can know about | 485 // |last_mouse_event_target_| is not owned by this class. We can know about |
| 469 // when it is destroyed via InstanceDeleted(). | 486 // when it is destroyed via InstanceDeleted(). |
| 470 webkit::ppapi::PluginInstance* last_mouse_event_target_; | 487 webkit::ppapi::PluginInstance* last_mouse_event_target_; |
| 471 | 488 |
| 472 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 489 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
| 473 | 490 |
| 474 scoped_ptr<PepperDeviceEnumerationEventHandler> | 491 scoped_ptr<PepperDeviceEnumerationEventHandler> |
| 475 device_enumeration_event_handler_; | 492 device_enumeration_event_handler_; |
| 476 | 493 |
| 477 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 494 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 478 }; | 495 }; |
| 479 | 496 |
| 480 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 497 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |