| 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  |    7  | 
|    8 #include <map> |    8 #include <map> | 
|    9 #include <set> |    9 #include <set> | 
|   10 #include <string> |   10 #include <string> | 
|   11 #include <vector> |   11 #include <vector> | 
|   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" |  | 
|   20 #include "content/public/renderer/render_view_observer.h" |   19 #include "content/public/renderer/render_view_observer.h" | 
|   21 #include "content/renderer/mouse_lock_dispatcher.h" |   20 #include "content/renderer/mouse_lock_dispatcher.h" | 
|   22 #include "content/renderer/pepper/pepper_parent_context_provider.h" |   21 #include "content/renderer/pepper/pepper_parent_context_provider.h" | 
 |   22 #include "content/renderer/render_view_pepper_helper.h" | 
|   23 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" |   23 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" | 
|   24 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" |   24 #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" | 
|   25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" |   25 #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" | 
|   26 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" |   26 #include "ppapi/shared_impl/private/udp_socket_private_impl.h" | 
|   27 #include "ui/base/ime/text_input_type.h" |   27 #include "ui/base/ime/text_input_type.h" | 
|   28 #include "webkit/plugins/ppapi/plugin_delegate.h" |   28 #include "webkit/plugins/ppapi/plugin_delegate.h" | 
|   29  |   29  | 
|   30 class FilePath; |   30 class FilePath; | 
|   31 class TransportDIB; |  | 
|   32  |  | 
|   33 namespace gfx { |  | 
|   34 class Point; |  | 
|   35 class Rect; |  | 
|   36 } |  | 
|   37  |   31  | 
|   38 namespace IPC { |   32 namespace IPC { | 
|   39 struct ChannelHandle; |   33 struct ChannelHandle; | 
|   40 } |   34 } | 
|   41  |   35  | 
|   42 namespace ppapi { |   36 namespace ppapi { | 
|   43 class PepperFilePath; |   37 class PepperFilePath; | 
|   44 class PPB_X509Certificate_Fields; |   38 class PPB_X509Certificate_Fields; | 
|   45 class PpapiPermissions; |   39 class PpapiPermissions; | 
|   46 } |   40 } | 
|   47  |   41  | 
|   48 namespace ui { |  | 
|   49 class Range; |  | 
|   50 } |  | 
|   51  |  | 
|   52 namespace webkit { |   42 namespace webkit { | 
|   53 struct WebPluginInfo; |   43 struct WebPluginInfo; | 
|   54 namespace ppapi { |   44 namespace ppapi { | 
|   55 class PluginInstance; |   45 class PluginInstance; | 
|   56 class PluginModule; |   46 class PluginModule; | 
|   57 } |   47 } | 
|   58 } |   48 } | 
|   59  |   49  | 
|   60 namespace WebKit { |   50 namespace WebKit { | 
|   61 class WebGamepads; |   51 class WebGamepads; | 
|   62 class WebMouseEvent; |  | 
|   63 struct WebCompositionUnderline; |   52 struct WebCompositionUnderline; | 
|   64 } |   53 } | 
|   65  |   54  | 
|   66 namespace content { |   55 namespace content { | 
|   67  |  | 
|   68 class GamepadSharedMemoryReader; |   56 class GamepadSharedMemoryReader; | 
|   69 class PepperBrokerImpl; |   57 class PepperBrokerImpl; | 
|   70 class PepperDeviceEnumerationEventHandler; |   58 class PepperDeviceEnumerationEventHandler; | 
|   71 class PepperPluginDelegateImpl; |  | 
|   72 class RenderViewImpl; |   59 class RenderViewImpl; | 
|   73  |   60  | 
|   74 class PepperPluginDelegateImpl |   61 class PepperPluginDelegateImpl | 
|   75     : public webkit::ppapi::PluginDelegate, |   62     : public webkit::ppapi::PluginDelegate, | 
 |   63       public RenderViewPepperHelper, | 
|   76       public base::SupportsWeakPtr<PepperPluginDelegateImpl>, |   64       public base::SupportsWeakPtr<PepperPluginDelegateImpl>, | 
|   77       public PepperParentContextProvider, |   65       public PepperParentContextProvider, | 
|   78       public RenderViewObserver { |   66       public RenderViewObserver { | 
|   79  public: |   67  public: | 
|   80   explicit PepperPluginDelegateImpl(RenderViewImpl* render_view); |   68   explicit PepperPluginDelegateImpl(RenderViewImpl* render_view); | 
|   81   virtual ~PepperPluginDelegateImpl(); |   69   virtual ~PepperPluginDelegateImpl(); | 
|   82  |   70  | 
|   83   RenderViewImpl* render_view() { return render_view_; } |   71   RenderViewImpl* render_view() { return render_view_; } | 
|   84  |   72  | 
|   85   // Attempts to create a PPAPI plugin for the given filepath. On success, it |  | 
|   86   // will return the newly-created module. |  | 
|   87   // |  | 
|   88   // There are two reasons for failure. The first is that the plugin isn't |  | 
|   89   // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set |  | 
|   90   // to false and the caller may want to fall back on creating an NPAPI plugin. |  | 
|   91   // the second is that the plugin failed to initialize. In this case, |  | 
|   92   // |*pepper_plugin_was_registered| will be set to true and the caller should |  | 
|   93   // not fall back on any other plugin types. |  | 
|   94   CONTENT_EXPORT scoped_refptr<webkit::ppapi::PluginModule> |  | 
|   95   CreatePepperPluginModule( |  | 
|   96       const webkit::WebPluginInfo& webplugin_info, |  | 
|   97       bool* pepper_plugin_was_registered); |  | 
|   98  |  | 
|   99   // Sets up the renderer host and out-of-process proxy for an external plugin |   73   // Sets up the renderer host and out-of-process proxy for an external plugin | 
|  100   // module. Returns the renderer host, or NULL if it couldn't be created. |   74   // module. Returns the renderer host, or NULL if it couldn't be created. | 
|  101   RendererPpapiHost* CreateExternalPluginModule( |   75   RendererPpapiHost* CreateExternalPluginModule( | 
|  102       scoped_refptr<webkit::ppapi::PluginModule> module, |   76       scoped_refptr<webkit::ppapi::PluginModule> module, | 
|  103       const FilePath& path, |   77       const FilePath& path, | 
|  104       ppapi::PpapiPermissions permissions, |   78       ppapi::PpapiPermissions permissions, | 
|  105       const IPC::ChannelHandle& channel_handle, |   79       const IPC::ChannelHandle& channel_handle, | 
|  106       int plugin_child_id); |   80       int plugin_child_id); | 
|  107  |   81  | 
|  108   // Called by RenderView to tell us about painting events, these two functions |   82   // Removes broker from pending_connect_broker_ if present. Returns true if so. | 
|  109   // just correspond to the WillInitiatePaint, DidInitiatePaint and |   83   bool StopWaitingForBrokerConnection(PepperBrokerImpl* broker); | 
|  110   // DidFlushPaint hooks in RenderView. |  | 
|  111   void ViewWillInitiatePaint(); |  | 
|  112   void ViewInitiatedPaint(); |  | 
|  113   void ViewFlushedPaint(); |  | 
|  114  |   84  | 
|  115   // Called by RenderView to implement the corresponding function in its base |   85   CONTENT_EXPORT int GetRoutingID() const; | 
|  116   // class RenderWidget (see that for more). |   86  | 
|  117   webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( |   87   typedef base::Callback<void (int /* request_id */, | 
 |   88                                bool /* succeeded */, | 
 |   89                                const std::string& /* label */)> | 
 |   90       OpenDeviceCallback; | 
 |   91  | 
 |   92   // Opens the specified device. The request ID passed into the callback will be | 
 |   93   // the same as the return value. If successful, the label passed into the | 
 |   94   // callback identifies a audio/video steam, which can be used to call | 
 |   95   // CloseDevice() and GetSesssionID(). | 
 |   96   int OpenDevice(PP_DeviceType_Dev type, | 
 |   97                  const std::string& device_id, | 
 |   98                  const OpenDeviceCallback& callback); | 
 |   99   void CloseDevice(const std::string& label); | 
 |  100   // Gets audio/video session ID given a label. | 
 |  101   int GetSessionID(PP_DeviceType_Dev type, const std::string& label); | 
 |  102  | 
 |  103  private: | 
 |  104   // RenderViewPepperHelper implementation. | 
 |  105   virtual WebKit::WebPlugin* CreatePepperWebPlugin( | 
 |  106     const webkit::WebPluginInfo& webplugin_info, | 
 |  107     const WebKit::WebPluginParams& params) OVERRIDE; | 
 |  108   virtual void ViewWillInitiatePaint() OVERRIDE; | 
 |  109   virtual void ViewInitiatedPaint() OVERRIDE; | 
 |  110   virtual void ViewFlushedPaint() OVERRIDE; | 
 |  111   virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( | 
|  118       const gfx::Rect& paint_bounds, |  112       const gfx::Rect& paint_bounds, | 
|  119       TransportDIB** dib, |  113       TransportDIB** dib, | 
|  120       gfx::Rect* location, |  114       gfx::Rect* location, | 
|  121       gfx::Rect* clip, |  115       gfx::Rect* clip, | 
|  122       float* scale_factor); |  116       float* scale_factor) OVERRIDE; | 
|  123  |  117   virtual void OnAsyncFileOpened(base::PlatformFileError error_code, | 
|  124   // Called by RenderView when ViewMsg_AsyncOpenFile_ACK. |  118                                  base::PlatformFile file, | 
|  125   void OnAsyncFileOpened(base::PlatformFileError error_code, |  119                                  int message_id) OVERRIDE; | 
|  126                          base::PlatformFile file, |  120   virtual void OnPpapiBrokerChannelCreated( | 
|  127                          int message_id); |  121       int request_id, | 
|  128  |  122       const IPC::ChannelHandle& handle) OVERRIDE; | 
|  129   // Called by RenderView when ViewMsg_PpapiBrokerChannelCreated. |  123   virtual void OnPpapiBrokerPermissionResult(int request_id, | 
|  130   void OnPpapiBrokerChannelCreated(int request_id, |  124                                              bool result) OVERRIDE; | 
|  131                                    const IPC::ChannelHandle& handle); |  125   virtual void OnSetFocus(bool has_focus) OVERRIDE; | 
|  132  |  126   virtual void PageVisibilityChanged(bool is_visible) OVERRIDE; | 
|  133   // Removes broker from pending_connect_broker_ if present. Returns true if so. |  127   virtual bool IsPluginFocused() const OVERRIDE; | 
|  134   bool StopWaitingForBrokerConnection(PepperBrokerImpl* broker); |  128   virtual gfx::Rect GetCaretBounds() const OVERRIDE; | 
|  135  |  129   virtual ui::TextInputType GetTextInputType() const OVERRIDE; | 
|  136   // Called when we know whether permission to access the PPAPI broker was |  130   virtual bool IsPluginAcceptingCompositionEvents() const OVERRIDE; | 
|  137   // granted. |  131   virtual bool CanComposeInline() const OVERRIDE; | 
|  138   void OnPpapiBrokerPermissionResult(int request_id, bool result); |  132   virtual void GetSurroundingText(string16* text, | 
|  139  |  133                                   ui::Range* range) const OVERRIDE; | 
|  140   // Notification that the render view has been focused or defocused. This |  134   virtual void OnImeSetComposition( | 
|  141   // notifies all of the plugins. |  | 
|  142   void OnSetFocus(bool has_focus); |  | 
|  143  |  | 
|  144   // Notification that the page visibility has changed. The default is visible. |  | 
|  145   void PageVisibilityChanged(bool is_visible); |  | 
|  146  |  | 
|  147   // IME status. |  | 
|  148   bool IsPluginFocused() const; |  | 
|  149   gfx::Rect GetCaretBounds() const; |  | 
|  150   ui::TextInputType GetTextInputType() const; |  | 
|  151   bool IsPluginAcceptingCompositionEvents() const; |  | 
|  152   bool CanComposeInline() const; |  | 
|  153   void GetSurroundingText(string16* text, ui::Range* range) const; |  | 
|  154  |  | 
|  155   // IME events. |  | 
|  156   void OnImeSetComposition( |  | 
|  157       const string16& text, |  135       const string16& text, | 
|  158       const std::vector<WebKit::WebCompositionUnderline>& underlines, |  136       const std::vector<WebKit::WebCompositionUnderline>& underlines, | 
|  159       int selection_start, |  137       int selection_start, | 
|  160       int selection_end); |  138       int selection_end) OVERRIDE; | 
|  161   void OnImeConfirmComposition(const string16& text); |  139   virtual void OnImeConfirmComposition(const string16& text) OVERRIDE; | 
|  162  |  140   virtual void WillHandleMouseEvent() OVERRIDE; | 
|  163   // Notification that a mouse event has arrived at the render view. |  | 
|  164   void WillHandleMouseEvent(); |  | 
|  165  |  141  | 
|  166   // PluginDelegate implementation. |  142   // PluginDelegate implementation. | 
|  167   virtual void PluginFocusChanged(webkit::ppapi::PluginInstance* instance, |  143   virtual void PluginFocusChanged(webkit::ppapi::PluginInstance* instance, | 
|  168                                   bool focused) OVERRIDE; |  144                                   bool focused) OVERRIDE; | 
|  169   virtual void PluginTextInputTypeChanged( |  145   virtual void PluginTextInputTypeChanged( | 
|  170       webkit::ppapi::PluginInstance* instance) OVERRIDE; |  146       webkit::ppapi::PluginInstance* instance) OVERRIDE; | 
|  171   virtual void PluginCaretPositionChanged( |  147   virtual void PluginCaretPositionChanged( | 
|  172       webkit::ppapi::PluginInstance* instance) OVERRIDE; |  148       webkit::ppapi::PluginInstance* instance) OVERRIDE; | 
|  173   virtual void PluginRequestedCancelComposition( |  149   virtual void PluginRequestedCancelComposition( | 
|  174       webkit::ppapi::PluginInstance* instance) OVERRIDE; |  150       webkit::ppapi::PluginInstance* instance) OVERRIDE; | 
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  262       const GURL& origin, |  238       const GURL& origin, | 
|  263       quota::StorageType type, |  239       quota::StorageType type, | 
|  264       const AvailableSpaceCallback& callback) OVERRIDE; |  240       const AvailableSpaceCallback& callback) OVERRIDE; | 
|  265   virtual void WillUpdateFile(const GURL& file_path) OVERRIDE; |  241   virtual void WillUpdateFile(const GURL& file_path) OVERRIDE; | 
|  266   virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE; |  242   virtual void DidUpdateFile(const GURL& file_path, int64_t delta) OVERRIDE; | 
|  267   virtual void SyncGetFileSystemPlatformPath( |  243   virtual void SyncGetFileSystemPlatformPath( | 
|  268       const GURL& url, |  244       const GURL& url, | 
|  269       FilePath* platform_path) OVERRIDE; |  245       FilePath* platform_path) OVERRIDE; | 
|  270   virtual scoped_refptr<base::MessageLoopProxy> |  246   virtual scoped_refptr<base::MessageLoopProxy> | 
|  271       GetFileThreadMessageLoopProxy() OVERRIDE; |  247       GetFileThreadMessageLoopProxy() OVERRIDE; | 
|  272  |  | 
|  273   virtual uint32 TCPSocketCreate() OVERRIDE; |  248   virtual uint32 TCPSocketCreate() OVERRIDE; | 
|  274   virtual void TCPSocketConnect( |  249   virtual void TCPSocketConnect( | 
|  275       webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |  250       webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 
|  276       uint32 socket_id, |  251       uint32 socket_id, | 
|  277       const std::string& host, |  252       const std::string& host, | 
|  278       uint16_t port) OVERRIDE; |  253       uint16_t port) OVERRIDE; | 
|  279   virtual void TCPSocketConnectWithNetAddress( |  254   virtual void TCPSocketConnectWithNetAddress( | 
|  280       webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |  255       webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 
|  281       uint32 socket_id, |  256       uint32 socket_id, | 
|  282       const PP_NetAddress_Private& addr) OVERRIDE; |  257       const PP_NetAddress_Private& addr) OVERRIDE; | 
|  283   virtual void TCPSocketSSLHandshake( |  258   virtual void TCPSocketSSLHandshake( | 
|  284       uint32 socket_id, |  259       uint32 socket_id, | 
|  285       const std::string& server_name, |  260       const std::string& server_name, | 
|  286       uint16_t server_port, |  261       uint16_t server_port, | 
|  287       const std::vector<std::vector<char> >& trusted_certs, |  262       const std::vector<std::vector<char> >& trusted_certs, | 
|  288       const std::vector<std::vector<char> >& untrusted_certs) OVERRIDE; |  263       const std::vector<std::vector<char> >& untrusted_certs) OVERRIDE; | 
|  289   virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; |  264   virtual void TCPSocketRead(uint32 socket_id, int32_t bytes_to_read) OVERRIDE; | 
|  290   virtual void TCPSocketWrite(uint32 socket_id, |  265   virtual void TCPSocketWrite(uint32 socket_id, | 
|  291                               const std::string& buffer) OVERRIDE; |  266                               const std::string& buffer) OVERRIDE; | 
|  292   virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; |  267   virtual void TCPSocketDisconnect(uint32 socket_id) OVERRIDE; | 
|  293   virtual void RegisterTCPSocket( |  268   virtual void RegisterTCPSocket( | 
|  294       webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |  269       webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 
|  295       uint32 socket_id) OVERRIDE; |  270       uint32 socket_id) OVERRIDE; | 
|  296  |  | 
|  297   virtual uint32 UDPSocketCreate() OVERRIDE; |  271   virtual uint32 UDPSocketCreate() OVERRIDE; | 
|  298   virtual void UDPSocketSetBoolSocketFeature( |  272   virtual void UDPSocketSetBoolSocketFeature( | 
|  299       webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |  273       webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | 
|  300       uint32 socket_id, |  274       uint32 socket_id, | 
|  301       int32_t name, |  275       int32_t name, | 
|  302       bool value) OVERRIDE; |  276       bool value) OVERRIDE; | 
|  303   virtual void UDPSocketBind( |  277   virtual void UDPSocketBind( | 
|  304       webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |  278       webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | 
|  305       uint32 socket_id, |  279       uint32 socket_id, | 
|  306       const PP_NetAddress_Private& addr) OVERRIDE; |  280       const PP_NetAddress_Private& addr) OVERRIDE; | 
|  307   virtual void UDPSocketRecvFrom(uint32 socket_id, |  281   virtual void UDPSocketRecvFrom(uint32 socket_id, | 
|  308                                  int32_t num_bytes) OVERRIDE; |  282                                  int32_t num_bytes) OVERRIDE; | 
|  309   virtual void UDPSocketSendTo(uint32 socket_id, |  283   virtual void UDPSocketSendTo(uint32 socket_id, | 
|  310                                const std::string& buffer, |  284                                const std::string& buffer, | 
|  311                                const PP_NetAddress_Private& addr) OVERRIDE; |  285                                const PP_NetAddress_Private& addr) OVERRIDE; | 
|  312   virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; |  286   virtual void UDPSocketClose(uint32 socket_id) OVERRIDE; | 
|  313   virtual void TCPServerSocketListen( |  287   virtual void TCPServerSocketListen( | 
|  314       PP_Resource socket_resource, |  288       PP_Resource socket_resource, | 
|  315       const PP_NetAddress_Private& addr, |  289       const PP_NetAddress_Private& addr, | 
|  316       int32_t backlog) OVERRIDE; |  290       int32_t backlog) OVERRIDE; | 
|  317   virtual void TCPServerSocketAccept(uint32 server_socket_id) OVERRIDE; |  291   virtual void TCPServerSocketAccept(uint32 server_socket_id) OVERRIDE; | 
|  318   virtual void TCPServerSocketStopListening( |  292   virtual void TCPServerSocketStopListening( | 
|  319       PP_Resource socket_resource, |  293       PP_Resource socket_resource, | 
|  320       uint32 socket_id) OVERRIDE; |  294       uint32 socket_id) OVERRIDE; | 
|  321  |  | 
|  322   virtual void RegisterHostResolver( |  295   virtual void RegisterHostResolver( | 
|  323       ppapi::PPB_HostResolver_Shared* host_resolver, |  296       ppapi::PPB_HostResolver_Shared* host_resolver, | 
|  324       uint32 host_resolver_id) OVERRIDE; |  297       uint32 host_resolver_id) OVERRIDE; | 
|  325   virtual void HostResolverResolve( |  298   virtual void HostResolverResolve( | 
|  326       uint32 host_resolver_id, |  299       uint32 host_resolver_id, | 
|  327       const ::ppapi::HostPortPair& host_port, |  300       const ::ppapi::HostPortPair& host_port, | 
|  328       const PP_HostResolver_Private_Hint* hint) OVERRIDE; |  301       const PP_HostResolver_Private_Hint* hint) OVERRIDE; | 
|  329   virtual void UnregisterHostResolver(uint32 host_resolver_id) OVERRIDE; |  302   virtual void UnregisterHostResolver(uint32 host_resolver_id) OVERRIDE; | 
|  330  |  | 
|  331   virtual bool AddNetworkListObserver( |  303   virtual bool AddNetworkListObserver( | 
|  332       webkit_glue::NetworkListObserver* observer) OVERRIDE; |  304       webkit_glue::NetworkListObserver* observer) OVERRIDE; | 
|  333   virtual void RemoveNetworkListObserver( |  305   virtual void RemoveNetworkListObserver( | 
|  334       webkit_glue::NetworkListObserver* observer) OVERRIDE; |  306       webkit_glue::NetworkListObserver* observer) OVERRIDE; | 
|  335  |  | 
|  336   virtual bool X509CertificateParseDER( |  307   virtual bool X509CertificateParseDER( | 
|  337       const std::vector<char>& der, |  308       const std::vector<char>& der, | 
|  338       ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; |  309       ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; | 
|  339   virtual webkit::ppapi::FullscreenContainer* |  310   virtual webkit::ppapi::FullscreenContainer* | 
|  340       CreateFullscreenContainer( |  311       CreateFullscreenContainer( | 
|  341           webkit::ppapi::PluginInstance* instance) OVERRIDE; |  312           webkit::ppapi::PluginInstance* instance) OVERRIDE; | 
|  342   virtual gfx::Size GetScreenSize() OVERRIDE; |  313   virtual gfx::Size GetScreenSize() OVERRIDE; | 
|  343   virtual std::string GetDefaultEncoding() OVERRIDE; |  314   virtual std::string GetDefaultEncoding() OVERRIDE; | 
|  344   virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) |  315   virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) | 
|  345       OVERRIDE; |  316       OVERRIDE; | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  413                                   uint32 accepted_socket_id, |  384                                   uint32 accepted_socket_id, | 
|  414                                   const PP_NetAddress_Private& local_addr, |  385                                   const PP_NetAddress_Private& local_addr, | 
|  415                                   const PP_NetAddress_Private& remote_addr); |  386                                   const PP_NetAddress_Private& remote_addr); | 
|  416   void OnHostResolverResolveACK( |  387   void OnHostResolverResolveACK( | 
|  417       uint32 plugin_dispatcher_id, |  388       uint32 plugin_dispatcher_id, | 
|  418       uint32 host_resolver_id, |  389       uint32 host_resolver_id, | 
|  419       bool succeeded, |  390       bool succeeded, | 
|  420       const std::string& canonical_name, |  391       const std::string& canonical_name, | 
|  421       const std::vector<PP_NetAddress_Private>& net_address_list); |  392       const std::vector<PP_NetAddress_Private>& net_address_list); | 
|  422  |  393  | 
|  423   CONTENT_EXPORT int GetRoutingID() const; |  394   // Attempts to create a PPAPI plugin for the given filepath. On success, it | 
 |  395   // will return the newly-created module. | 
 |  396   // | 
 |  397   // There are two reasons for failure. The first is that the plugin isn't | 
 |  398   // a PPAPI plugin. In this case, |*pepper_plugin_was_registered| will be set | 
 |  399   // to false and the caller may want to fall back on creating an NPAPI plugin. | 
 |  400   // the second is that the plugin failed to initialize. In this case, | 
 |  401   // |*pepper_plugin_was_registered| will be set to true and the caller should | 
 |  402   // not fall back on any other plugin types. | 
 |  403   scoped_refptr<webkit::ppapi::PluginModule> | 
 |  404   CreatePepperPluginModule( | 
 |  405       const webkit::WebPluginInfo& webplugin_info, | 
 |  406       bool* pepper_plugin_was_registered); | 
|  424  |  407  | 
|  425   typedef base::Callback<void (int /* request_id */, |  | 
|  426                                bool /* succeeded */, |  | 
|  427                                const std::string& /* label */)> |  | 
|  428       OpenDeviceCallback; |  | 
|  429  |  | 
|  430   // Opens the specified device. The request ID passed into the callback will be |  | 
|  431   // the same as the return value. If successful, the label passed into the |  | 
|  432   // callback identifies a audio/video steam, which can be used to call |  | 
|  433   // CloseDevice() and GetSesssionID(). |  | 
|  434   int OpenDevice(PP_DeviceType_Dev type, |  | 
|  435                  const std::string& device_id, |  | 
|  436                  const OpenDeviceCallback& callback); |  | 
|  437   void CloseDevice(const std::string& label); |  | 
|  438   // Gets audio/video session ID given a label. |  | 
|  439   int GetSessionID(PP_DeviceType_Dev type, const std::string& label); |  | 
|  440  |  | 
|  441  private: |  | 
|  442   // Asynchronously attempts to create a PPAPI broker for the given plugin. |  408   // Asynchronously attempts to create a PPAPI broker for the given plugin. | 
|  443   scoped_refptr<PepperBrokerImpl> CreateBroker( |  409   scoped_refptr<PepperBrokerImpl> CreateBroker( | 
|  444       webkit::ppapi::PluginModule* plugin_module); |  410       webkit::ppapi::PluginModule* plugin_module); | 
|  445  |  411  | 
|  446   // Create a new HostDispatcher for proxying, hook it to the PluginModule, |  412   // Create a new HostDispatcher for proxying, hook it to the PluginModule, | 
|  447   // and perform other common initialization. |  413   // and perform other common initialization. | 
|  448   RendererPpapiHost* CreateOutOfProcessModule( |  414   RendererPpapiHost* CreateOutOfProcessModule( | 
|  449       webkit::ppapi::PluginModule* module, |  415       webkit::ppapi::PluginModule* module, | 
|  450       const FilePath& path, |  416       const FilePath& path, | 
|  451       ppapi::PpapiPermissions permissions, |  417       ppapi::PpapiPermissions permissions, | 
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  506  |  472  | 
|  507   scoped_ptr<PepperDeviceEnumerationEventHandler> |  473   scoped_ptr<PepperDeviceEnumerationEventHandler> | 
|  508       device_enumeration_event_handler_; |  474       device_enumeration_event_handler_; | 
|  509  |  475  | 
|  510   DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); |  476   DISALLOW_COPY_AND_ASSIGN(PepperPluginDelegateImpl); | 
|  511 }; |  477 }; | 
|  512  |  478  | 
|  513 }  // namespace content |  479 }  // namespace content | 
|  514  |  480  | 
|  515 #endif  // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ |  481 #endif  // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_DELEGATE_IMPL_H_ | 
| OLD | NEW |