| 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_tcp_server_socket_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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | 287 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |
| 287 uint32 socket_id, | 288 uint32 socket_id, |
| 288 const PP_NetAddress_Private& addr) OVERRIDE; | 289 const PP_NetAddress_Private& addr) OVERRIDE; |
| 289 virtual void UDPSocketRecvFrom(uint32 socket_id, | 290 virtual void UDPSocketRecvFrom(uint32 socket_id, |
| 290 int32_t num_bytes) OVERRIDE; | 291 int32_t num_bytes) OVERRIDE; |
| 291 virtual void UDPSocketSendTo(uint32 socket_id, | 292 virtual void UDPSocketSendTo(uint32 socket_id, |
| 292 const std::string& buffer, | 293 const std::string& buffer, |
| 293 const PP_NetAddress_Private& addr) OVERRIDE; | 294 const PP_NetAddress_Private& addr) OVERRIDE; |
| 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 PP_Resource socket_resource, |
| 297 uint32 temp_socket_id, | |
| 298 const PP_NetAddress_Private& addr, | 298 const PP_NetAddress_Private& addr, |
| 299 int32_t backlog) OVERRIDE; | 299 int32_t backlog) OVERRIDE; |
| 300 virtual void TCPServerSocketAccept(uint32 real_socket_id) OVERRIDE; | 300 virtual void TCPServerSocketAccept(uint32 server_socket_id) OVERRIDE; |
| 301 virtual void TCPServerSocketStopListening(uint32 real_socket_id, | 301 virtual void TCPServerSocketStopListening( |
| 302 uint32 temp_socket_id) OVERRIDE; | 302 PP_Resource socket_resource, |
| 303 uint32 socket_id) OVERRIDE; |
| 303 | 304 |
| 304 virtual bool AddNetworkListObserver( | 305 virtual bool AddNetworkListObserver( |
| 305 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 306 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
| 306 virtual void RemoveNetworkListObserver( | 307 virtual void RemoveNetworkListObserver( |
| 307 webkit_glue::NetworkListObserver* observer) OVERRIDE; | 308 webkit_glue::NetworkListObserver* observer) OVERRIDE; |
| 308 | 309 |
| 309 virtual int32_t ShowContextMenu( | 310 virtual int32_t ShowContextMenu( |
| 310 webkit::ppapi::PluginInstance* instance, | 311 webkit::ppapi::PluginInstance* instance, |
| 311 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 312 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| 312 const gfx::Point& position) OVERRIDE; | 313 const gfx::Point& position) OVERRIDE; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, | 379 void OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, |
| 379 uint32 socket_id, | 380 uint32 socket_id, |
| 380 bool succeeded, | 381 bool succeeded, |
| 381 int32_t bytes_written); | 382 int32_t bytes_written); |
| 382 void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id, | 383 void OnUDPSocketRecvFromACK(uint32 plugin_dispatcher_id, |
| 383 uint32 socket_id, | 384 uint32 socket_id, |
| 384 bool succeeded, | 385 bool succeeded, |
| 385 const std::string& data, | 386 const std::string& data, |
| 386 const PP_NetAddress_Private& addr); | 387 const PP_NetAddress_Private& addr); |
| 387 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, | 388 void OnTCPServerSocketListenACK(uint32 plugin_dispatcher_id, |
| 388 uint32 real_socket_id, | 389 PP_Resource socket_resource, |
| 389 uint32 temp_socket_id, | 390 uint32 socket_id, |
| 390 int32_t status); | 391 int32_t status); |
| 391 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, | 392 void OnTCPServerSocketAcceptACK(uint32 plugin_dispatcher_id, |
| 392 uint32 real_server_socket_id, | 393 uint32 socket_id, |
| 393 uint32 accepted_socket_id, | 394 uint32 accepted_socket_id, |
| 394 const PP_NetAddress_Private& local_addr, | 395 const PP_NetAddress_Private& local_addr, |
| 395 const PP_NetAddress_Private& remote_addr); | 396 const PP_NetAddress_Private& remote_addr); |
| 396 | 397 |
| 397 CONTENT_EXPORT int GetRoutingID() const; | 398 CONTENT_EXPORT int GetRoutingID() const; |
| 398 | 399 |
| 399 typedef base::Callback<void (int /* request_id */, | 400 typedef base::Callback<void (int /* request_id */, |
| 400 bool /* succeeded */, | 401 bool /* succeeded */, |
| 401 const std::string& /* label */)> | 402 const std::string& /* label */)> |
| 402 OpenDeviceCallback; | 403 OpenDeviceCallback; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 439 |
| 439 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 440 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 440 | 441 |
| 441 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, | 442 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, |
| 442 IDMapOwnPointer> pending_connect_tcps_; | 443 IDMapOwnPointer> pending_connect_tcps_; |
| 443 | 444 |
| 444 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; | 445 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; |
| 445 | 446 |
| 446 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; | 447 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; |
| 447 | 448 |
| 448 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> tcp_server_sockets_; | 449 IDMap<ppapi::PPB_TCPServerSocket_Shared> tcp_server_sockets_; |
| 449 | |
| 450 IDMap<webkit::ppapi::PPB_TCPServerSocket_Private_Impl> | |
| 451 uninitialized_tcp_server_sockets_; | |
| 452 | 450 |
| 453 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, | 451 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
| 454 IDMapOwnPointer> pending_context_menus_; | 452 IDMapOwnPointer> pending_context_menus_; |
| 455 | 453 |
| 456 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; | 454 typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; |
| 457 BrokerMap pending_connect_broker_; | 455 BrokerMap pending_connect_broker_; |
| 458 | 456 |
| 459 // Whether or not the focus is on a PPAPI plugin | 457 // Whether or not the focus is on a PPAPI plugin |
| 460 webkit::ppapi::PluginInstance* focused_plugin_; | 458 webkit::ppapi::PluginInstance* focused_plugin_; |
| 461 | 459 |
| 462 // Current text input composition text. Empty if no composition is in | 460 // Current text input composition text. Empty if no composition is in |
| 463 // progress. | 461 // progress. |
| 464 string16 composition_text_; | 462 string16 composition_text_; |
| 465 | 463 |
| 466 // The plugin instance that received the last mouse event. It is set to NULL | 464 // 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. | 465 // 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 | 466 // |last_mouse_event_target_| is not owned by this class. We can know about |
| 469 // when it is destroyed via InstanceDeleted(). | 467 // when it is destroyed via InstanceDeleted(). |
| 470 webkit::ppapi::PluginInstance* last_mouse_event_target_; | 468 webkit::ppapi::PluginInstance* last_mouse_event_target_; |
| 471 | 469 |
| 472 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; | 470 scoped_ptr<content::GamepadSharedMemoryReader> gamepad_shared_memory_reader_; |
| 473 | 471 |
| 474 scoped_ptr<PepperDeviceEnumerationEventHandler> | 472 scoped_ptr<PepperDeviceEnumerationEventHandler> |
| 475 device_enumeration_event_handler_; | 473 device_enumeration_event_handler_; |
| 476 | 474 |
| 477 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 475 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 478 }; | 476 }; |
| 479 | 477 |
| 480 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 478 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |