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 WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 namespace ppapi { | 71 namespace ppapi { |
72 | 72 |
73 class FileIO; | 73 class FileIO; |
74 class FullscreenContainer; | 74 class FullscreenContainer; |
75 class PepperFilePath; | 75 class PepperFilePath; |
76 class PluginInstance; | 76 class PluginInstance; |
77 class PluginModule; | 77 class PluginModule; |
78 class PPB_Broker_Impl; | 78 class PPB_Broker_Impl; |
79 class PPB_Flash_Menu_Impl; | 79 class PPB_Flash_Menu_Impl; |
80 class PPB_Flash_NetConnector_Impl; | 80 class PPB_Flash_NetConnector_Impl; |
81 class PPB_TCPSocket_Private_Impl; | |
82 class PPB_UDPSocket_Private_Impl; | |
83 | 81 |
84 // Virtual interface that the browser implements to implement features for | 82 // Virtual interface that the browser implements to implement features for |
85 // PPAPI plugins. | 83 // PPAPI plugins. |
86 class PluginDelegate { | 84 class PluginDelegate { |
87 public: | 85 public: |
88 // This interface is used for the PluginModule to tell the code in charge of | 86 // This interface is used for the PluginModule to tell the code in charge of |
89 // re-using modules which modules currently exist. | 87 // re-using modules which modules currently exist. |
90 // | 88 // |
91 // It is different than the other interfaces, which are scoped to the | 89 // It is different than the other interfaces, which are scoped to the |
92 // lifetime of the plugin instance. The implementor of this interface must | 90 // lifetime of the plugin instance. The implementor of this interface must |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 GetFileThreadMessageLoopProxy() = 0; | 399 GetFileThreadMessageLoopProxy() = 0; |
402 | 400 |
403 virtual int32_t ConnectTcp( | 401 virtual int32_t ConnectTcp( |
404 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 402 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
405 const char* host, | 403 const char* host, |
406 uint16_t port) = 0; | 404 uint16_t port) = 0; |
407 virtual int32_t ConnectTcpAddress( | 405 virtual int32_t ConnectTcpAddress( |
408 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 406 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
409 const PP_NetAddress_Private* addr) = 0; | 407 const PP_NetAddress_Private* addr) = 0; |
410 | 408 |
411 // For PPB_TCPSocket_Private. | |
412 virtual uint32 TCPSocketCreate() = 0; | |
413 virtual void TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket, | |
414 uint32 socket_id, | |
415 const std::string& host, | |
416 uint16_t port) = 0; | |
417 virtual void TCPSocketConnectWithNetAddress( | |
418 PPB_TCPSocket_Private_Impl* socket, | |
419 uint32 socket_id, | |
420 const PP_NetAddress_Private& addr) = 0; | |
421 virtual void TCPSocketSSLHandshake(uint32 socket_id, | |
422 const std::string& server_name, | |
423 uint16_t server_port) = 0; | |
424 virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) = 0; | |
425 virtual void TCPSocketWrite(uint32 socket_id, const std::string& buffer) = 0; | |
426 virtual void TCPSocketDisconnect(uint32 socket_id) = 0; | |
427 | |
428 // For PPB_UDPSocket_Private. | |
429 virtual uint32 UDPSocketCreate() = 0; | |
430 virtual void UDPSocketBind(PPB_UDPSocket_Private_Impl* socket, | |
431 uint32 socket_id, | |
432 const PP_NetAddress_Private& addr) = 0; | |
433 virtual void UDPSocketRecvFrom(uint32 socket_id, int32_t num_bytes) = 0; | |
434 virtual void UDPSocketSendTo(uint32 socket_id, | |
435 const std::string& buffer, | |
436 const PP_NetAddress_Private& addr) = 0; | |
437 virtual void UDPSocketClose(uint32 socket_id) = 0; | |
438 | |
439 // Show the given context menu at the given position (in the plugin's | 409 // Show the given context menu at the given position (in the plugin's |
440 // coordinates). | 410 // coordinates). |
441 virtual int32_t ShowContextMenu( | 411 virtual int32_t ShowContextMenu( |
442 PluginInstance* instance, | 412 PluginInstance* instance, |
443 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 413 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
444 const gfx::Point& position) = 0; | 414 const gfx::Point& position) = 0; |
445 | 415 |
446 // Create a fullscreen container for a plugin instance. This effectively | 416 // Create a fullscreen container for a plugin instance. This effectively |
447 // switches the plugin to fullscreen. | 417 // switches the plugin to fullscreen. |
448 virtual FullscreenContainer* CreateFullscreenContainer( | 418 virtual FullscreenContainer* CreateFullscreenContainer( |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 virtual void DidReceiveMouseEvent(PluginInstance* instance) = 0; | 483 virtual void DidReceiveMouseEvent(PluginInstance* instance) = 0; |
514 | 484 |
515 // Determines if the browser entered fullscreen mode. | 485 // Determines if the browser entered fullscreen mode. |
516 virtual bool IsInFullscreenMode() = 0; | 486 virtual bool IsInFullscreenMode() = 0; |
517 }; | 487 }; |
518 | 488 |
519 } // namespace ppapi | 489 } // namespace ppapi |
520 } // namespace webkit | 490 } // namespace webkit |
521 | 491 |
522 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ | 492 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ |
OLD | NEW |