| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PLUGIN_DELEGATE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> |
| 9 #include <map> | 10 #include <map> |
| 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/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/renderer/pepper_parent_context_provider.h" | 18 #include "content/renderer/pepper_parent_context_provider.h" |
| 19 #include "ppapi/proxy/broker_dispatcher.h" | 19 #include "ppapi/proxy/broker_dispatcher.h" |
| 20 #include "ppapi/proxy/proxy_channel.h" | 20 #include "ppapi/proxy/proxy_channel.h" |
| 21 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | |
| 22 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" | |
| 23 #include "ui/base/ime/text_input_type.h" | 21 #include "ui/base/ime/text_input_type.h" |
| 24 #include "webkit/plugins/ppapi/plugin_delegate.h" | 22 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 25 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 23 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
| 26 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" | 24 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
| 27 | 25 |
| 28 class FilePath; | 26 class FilePath; |
| 29 class PepperPluginDelegateImpl; | 27 class PepperPluginDelegateImpl; |
| 30 class RenderViewImpl; | 28 class RenderViewImpl; |
| 31 | 29 |
| 32 namespace gfx { | 30 namespace gfx { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 uint16_t port) OVERRIDE; | 303 uint16_t port) OVERRIDE; |
| 306 virtual int32_t ConnectTcpAddress( | 304 virtual int32_t ConnectTcpAddress( |
| 307 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 305 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
| 308 const struct PP_NetAddress_Private* addr) OVERRIDE; | 306 const struct PP_NetAddress_Private* addr) OVERRIDE; |
| 309 // This is the completion for both |ConnectTcp()| and |ConnectTcpAddress()|. | 307 // This is the completion for both |ConnectTcp()| and |ConnectTcpAddress()|. |
| 310 void OnConnectTcpACK( | 308 void OnConnectTcpACK( |
| 311 int request_id, | 309 int request_id, |
| 312 base::PlatformFile socket, | 310 base::PlatformFile socket, |
| 313 const PP_NetAddress_Private& local_addr, | 311 const PP_NetAddress_Private& local_addr, |
| 314 const PP_NetAddress_Private& remote_addr); | 312 const PP_NetAddress_Private& remote_addr); |
| 315 | |
| 316 virtual uint32 TCPSocketCreate() OVERRIDE; | |
| 317 virtual void TCPSocketConnect( | |
| 318 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | |
| 319 uint32 socket_id, | |
| 320 const std::string& host, | |
| 321 uint16_t port) OVERRIDE; | |
| 322 virtual void TCPSocketConnectWithNetAddress( | |
| 323 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | |
| 324 uint32 socket_id, | |
| 325 const PP_NetAddress_Private& addr) OVERRIDE; | |
| 326 void OnTCPSocketConnectACK(uint32 socket_id, | |
| 327 bool succeeded, | |
| 328 const PP_NetAddress_Private& local_addr, | |
| 329 const PP_NetAddress_Private& remote_addr); | |
| 330 | |
| 331 virtual void TCPSocketSSLHandshake(uint32 socket_id, | |
| 332 const std::string& server_name, | |
| 333 uint16_t server_port) OVERRIDE; | |
| 334 void OnTCPSocketSSLHandshakeACK(uint32 socket_id, bool succeeded); | |
| 335 | |
| 336 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; | |
| 337 void OnTCPSocketReadACK(uint32 socket_id, | |
| 338 bool succeeded, | |
| 339 const std::string& data); | |
| 340 | |
| 341 virtual void TCPSocketWrite(uint32 socket_id, | |
| 342 const std::string& buffer) OVERRIDE; | |
| 343 void OnTCPSocketWriteACK(uint32 socket_id, | |
| 344 bool succeeded, | |
| 345 int32_t bytes_written); | |
| 346 | |
| 347 virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; | |
| 348 | |
| 349 virtual uint32 UDPSocketCreate() OVERRIDE; | |
| 350 | |
| 351 virtual void UDPSocketBind( | |
| 352 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | |
| 353 uint32 socket_id, | |
| 354 const PP_NetAddress_Private& addr) OVERRIDE; | |
| 355 void OnUDPSocketBindACK(uint32 socket_id, bool succeeded); | |
| 356 | |
| 357 virtual void UDPSocketRecvFrom(uint32 socket_id, | |
| 358 int32_t num_bytes) OVERRIDE; | |
| 359 void OnUDPSocketRecvFromACK(uint32 socket_id, | |
| 360 bool succeeded, | |
| 361 const std::string& data, | |
| 362 const PP_NetAddress_Private& remote_addr); | |
| 363 | |
| 364 virtual void UDPSocketSendTo(uint32 socket_id, | |
| 365 const std::string& buffer, | |
| 366 const PP_NetAddress_Private& addr) OVERRIDE; | |
| 367 void OnUDPSocketSendToACK(uint32 socket_id, | |
| 368 bool succeeded, | |
| 369 int32_t bytes_written); | |
| 370 | |
| 371 virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; | |
| 372 | |
| 373 virtual int32_t ShowContextMenu( | 313 virtual int32_t ShowContextMenu( |
| 374 webkit::ppapi::PluginInstance* instance, | 314 webkit::ppapi::PluginInstance* instance, |
| 375 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 315 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| 376 const gfx::Point& position) OVERRIDE; | 316 const gfx::Point& position) OVERRIDE; |
| 377 void OnContextMenuClosed( | 317 void OnContextMenuClosed( |
| 378 const webkit_glue::CustomContextMenuContext& custom_context); | 318 const webkit_glue::CustomContextMenuContext& custom_context); |
| 379 void OnCustomContextMenuAction( | 319 void OnCustomContextMenuAction( |
| 380 const webkit_glue::CustomContextMenuContext& custom_context, | 320 const webkit_glue::CustomContextMenuContext& custom_context, |
| 381 unsigned action); | 321 unsigned action); |
| 382 void CompleteShowContextMenu(int request_id, | 322 void CompleteShowContextMenu(int request_id, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 | 369 |
| 430 // Used to send a single context menu "completion" upon menu close. | 370 // Used to send a single context menu "completion" upon menu close. |
| 431 bool has_saved_context_menu_action_; | 371 bool has_saved_context_menu_action_; |
| 432 unsigned saved_context_menu_action_; | 372 unsigned saved_context_menu_action_; |
| 433 | 373 |
| 434 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 374 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
| 435 | 375 |
| 436 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, | 376 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, |
| 437 IDMapOwnPointer> pending_connect_tcps_; | 377 IDMapOwnPointer> pending_connect_tcps_; |
| 438 | 378 |
| 439 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; | |
| 440 | |
| 441 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; | |
| 442 | |
| 443 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, | 379 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
| 444 IDMapOwnPointer> pending_context_menus_; | 380 IDMapOwnPointer> pending_context_menus_; |
| 445 | 381 |
| 446 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; | 382 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; |
| 447 BrokerMap pending_connect_broker_; | 383 BrokerMap pending_connect_broker_; |
| 448 | 384 |
| 449 // Whether or not the focus is on a PPAPI plugin | 385 // Whether or not the focus is on a PPAPI plugin |
| 450 webkit::ppapi::PluginInstance* focused_plugin_; | 386 webkit::ppapi::PluginInstance* focused_plugin_; |
| 451 | 387 |
| 452 // Current text input composition text. Empty if no composition is in | 388 // Current text input composition text. Empty if no composition is in |
| (...skipping 18 matching lines...) Expand all Loading... |
| 471 // The plugin instance that received the last mouse event. It is set to NULL | 407 // The plugin instance that received the last mouse event. It is set to NULL |
| 472 // if the last mouse event went to elements other than Pepper plugins. | 408 // if the last mouse event went to elements other than Pepper plugins. |
| 473 // |last_mouse_event_target_| is not owned by this class. We can know about | 409 // |last_mouse_event_target_| is not owned by this class. We can know about |
| 474 // when it is destroyed via InstanceDeleted(). | 410 // when it is destroyed via InstanceDeleted(). |
| 475 webkit::ppapi::PluginInstance* last_mouse_event_target_; | 411 webkit::ppapi::PluginInstance* last_mouse_event_target_; |
| 476 | 412 |
| 477 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 413 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
| 478 }; | 414 }; |
| 479 | 415 |
| 480 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 416 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
| OLD | NEW |