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 <map> |
9 #include <set> | 10 #include <set> |
10 #include <map> | |
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" |
21 #include "ui/base/ime/text_input_type.h" | 23 #include "ui/base/ime/text_input_type.h" |
22 #include "webkit/plugins/ppapi/plugin_delegate.h" | 24 #include "webkit/plugins/ppapi/plugin_delegate.h" |
23 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 25 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
24 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" | 26 #include "webkit/plugins/ppapi/ppb_flash_menu_impl.h" |
25 | 27 |
26 class FilePath; | 28 class FilePath; |
27 class PepperPluginDelegateImpl; | 29 class PepperPluginDelegateImpl; |
28 class RenderViewImpl; | 30 class RenderViewImpl; |
29 | 31 |
30 namespace gfx { | 32 namespace gfx { |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 uint16_t port) OVERRIDE; | 305 uint16_t port) OVERRIDE; |
304 virtual int32_t ConnectTcpAddress( | 306 virtual int32_t ConnectTcpAddress( |
305 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 307 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
306 const struct PP_NetAddress_Private* addr) OVERRIDE; | 308 const struct PP_NetAddress_Private* addr) OVERRIDE; |
307 // This is the completion for both |ConnectTcp()| and |ConnectTcpAddress()|. | 309 // This is the completion for both |ConnectTcp()| and |ConnectTcpAddress()|. |
308 void OnConnectTcpACK( | 310 void OnConnectTcpACK( |
309 int request_id, | 311 int request_id, |
310 base::PlatformFile socket, | 312 base::PlatformFile socket, |
311 const PP_NetAddress_Private& local_addr, | 313 const PP_NetAddress_Private& local_addr, |
312 const PP_NetAddress_Private& remote_addr); | 314 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 |
313 virtual int32_t ShowContextMenu( | 373 virtual int32_t ShowContextMenu( |
314 webkit::ppapi::PluginInstance* instance, | 374 webkit::ppapi::PluginInstance* instance, |
315 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 375 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
316 const gfx::Point& position) OVERRIDE; | 376 const gfx::Point& position) OVERRIDE; |
317 void OnContextMenuClosed( | 377 void OnContextMenuClosed( |
318 const webkit_glue::CustomContextMenuContext& custom_context); | 378 const webkit_glue::CustomContextMenuContext& custom_context); |
319 void OnCustomContextMenuAction( | 379 void OnCustomContextMenuAction( |
320 const webkit_glue::CustomContextMenuContext& custom_context, | 380 const webkit_glue::CustomContextMenuContext& custom_context, |
321 unsigned action); | 381 unsigned action); |
322 void CompleteShowContextMenu(int request_id, | 382 void CompleteShowContextMenu(int request_id, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 429 |
370 // Used to send a single context menu "completion" upon menu close. | 430 // Used to send a single context menu "completion" upon menu close. |
371 bool has_saved_context_menu_action_; | 431 bool has_saved_context_menu_action_; |
372 unsigned saved_context_menu_action_; | 432 unsigned saved_context_menu_action_; |
373 | 433 |
374 IDMap<AsyncOpenFileCallback> pending_async_open_files_; | 434 IDMap<AsyncOpenFileCallback> pending_async_open_files_; |
375 | 435 |
376 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, | 436 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>, |
377 IDMapOwnPointer> pending_connect_tcps_; | 437 IDMapOwnPointer> pending_connect_tcps_; |
378 | 438 |
| 439 IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; |
| 440 |
| 441 IDMap<webkit::ppapi::PPB_UDPSocket_Private_Impl> udp_sockets_; |
| 442 |
379 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, | 443 IDMap<scoped_refptr<webkit::ppapi::PPB_Flash_Menu_Impl>, |
380 IDMapOwnPointer> pending_context_menus_; | 444 IDMapOwnPointer> pending_context_menus_; |
381 | 445 |
382 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; | 446 typedef IDMap<scoped_refptr<PpapiBrokerImpl>, IDMapOwnPointer> BrokerMap; |
383 BrokerMap pending_connect_broker_; | 447 BrokerMap pending_connect_broker_; |
384 | 448 |
385 // Whether or not the focus is on a PPAPI plugin | 449 // Whether or not the focus is on a PPAPI plugin |
386 webkit::ppapi::PluginInstance* focused_plugin_; | 450 webkit::ppapi::PluginInstance* focused_plugin_; |
387 | 451 |
388 // Current text input composition text. Empty if no composition is in | 452 // Current text input composition text. Empty if no composition is in |
(...skipping 18 matching lines...) Expand all Loading... |
407 // The plugin instance that received the last mouse event. It is set to NULL | 471 // The plugin instance that received the last mouse event. It is set to NULL |
408 // if the last mouse event went to elements other than Pepper plugins. | 472 // if the last mouse event went to elements other than Pepper plugins. |
409 // |last_mouse_event_target_| is not owned by this class. We can know about | 473 // |last_mouse_event_target_| is not owned by this class. We can know about |
410 // when it is destroyed via InstanceDeleted(). | 474 // when it is destroyed via InstanceDeleted(). |
411 webkit::ppapi::PluginInstance* last_mouse_event_target_; | 475 webkit::ppapi::PluginInstance* last_mouse_event_target_; |
412 | 476 |
413 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 477 DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |
414 }; | 478 }; |
415 | 479 |
416 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 480 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |
OLD | NEW |