| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 5 #ifndef CHROME_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
| 6 #define CHROME_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 6 #define CHROME_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/gfx/rect.h" | 10 #include "base/gfx/rect.h" |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| 12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
| 13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "chrome/common/transport_dib.h" | 14 #include "chrome/common/transport_dib.h" |
| 15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
| 16 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
| 17 #include "third_party/npapi/bindings/npapi.h" | 17 #include "third_party/npapi/bindings/npapi.h" |
| 18 | 18 |
| 19 class PluginChannel; | 19 class PluginChannel; |
| 20 class WebPluginProxy; | 20 class WebPluginProxy; |
| 21 struct PluginMsg_Init_Params; | 21 struct PluginMsg_Init_Params; |
| 22 struct PluginMsg_DidReceiveResponseParams; | 22 struct PluginMsg_DidReceiveResponseParams; |
| 23 struct PluginMsg_UpdateGeometry_Param; |
| 23 struct PluginMsg_URLRequestReply_Params; | 24 struct PluginMsg_URLRequestReply_Params; |
| 24 class WebCursor; | 25 class WebCursor; |
| 25 | 26 |
| 26 namespace WebKit { | 27 namespace WebKit { |
| 27 class WebInputEvent; | 28 class WebInputEvent; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace webkit_glue { | 31 class WebPluginDelegateImpl; |
| 31 class WebPluginDelegate; | |
| 32 } | |
| 33 | 32 |
| 34 // Converts the IPC messages from WebPluginDelegateProxy into calls to the | 33 // Converts the IPC messages from WebPluginDelegateProxy into calls to the |
| 35 // actual WebPluginDelegate object. | 34 // actual WebPluginDelegate object. |
| 36 class WebPluginDelegateStub : public IPC::Channel::Listener, | 35 class WebPluginDelegateStub : public IPC::Channel::Listener, |
| 37 public IPC::Message::Sender, | 36 public IPC::Message::Sender, |
| 38 public base::RefCounted<WebPluginDelegateStub> { | 37 public base::RefCounted<WebPluginDelegateStub> { |
| 39 public: | 38 public: |
| 40 WebPluginDelegateStub(const std::string& mime_type, int instance_id, | 39 WebPluginDelegateStub(const std::string& mime_type, int instance_id, |
| 41 PluginChannel* channel); | 40 PluginChannel* channel); |
| 42 ~WebPluginDelegateStub(); | 41 ~WebPluginDelegateStub(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 65 intptr_t notify_data); | 64 intptr_t notify_data); |
| 66 void OnSetFocus(); | 65 void OnSetFocus(); |
| 67 void OnHandleInputEvent(const WebKit::WebInputEvent* event, | 66 void OnHandleInputEvent(const WebKit::WebInputEvent* event, |
| 68 bool* handled, WebCursor* cursor); | 67 bool* handled, WebCursor* cursor); |
| 69 | 68 |
| 70 void OnPaint(const gfx::Rect& damaged_rect); | 69 void OnPaint(const gfx::Rect& damaged_rect); |
| 71 void OnDidPaint(); | 70 void OnDidPaint(); |
| 72 | 71 |
| 73 void OnPrint(base::SharedMemoryHandle* shared_memory, size_t* size); | 72 void OnPrint(base::SharedMemoryHandle* shared_memory, size_t* size); |
| 74 | 73 |
| 75 void OnUpdateGeometry(const gfx::Rect& window_rect, | 74 void OnUpdateGeometry(const PluginMsg_UpdateGeometry_Param& param); |
| 76 const gfx::Rect& clip_rect, | |
| 77 const TransportDIB::Handle& windowless_buffer, | |
| 78 const TransportDIB::Handle& background_buffer); | |
| 79 void OnGetPluginScriptableObject(int* route_id, intptr_t* npobject_ptr); | 75 void OnGetPluginScriptableObject(int* route_id, intptr_t* npobject_ptr); |
| 80 void OnSendJavaScriptStream(const GURL& url, | 76 void OnSendJavaScriptStream(const GURL& url, |
| 81 const std::string& result, | 77 const std::string& result, |
| 82 bool success, bool notify_needed, | 78 bool success, bool notify_needed, |
| 83 intptr_t notify_data); | 79 intptr_t notify_data); |
| 84 | 80 |
| 85 void OnDidReceiveManualResponse( | 81 void OnDidReceiveManualResponse( |
| 86 const GURL& url, | 82 const GURL& url, |
| 87 const PluginMsg_DidReceiveResponseParams& params); | 83 const PluginMsg_DidReceiveResponseParams& params); |
| 88 void OnDidReceiveManualData(const std::vector<char>& buffer); | 84 void OnDidReceiveManualData(const std::vector<char>& buffer); |
| 89 void OnDidFinishManualLoading(); | 85 void OnDidFinishManualLoading(); |
| 90 void OnDidManualLoadFail(); | 86 void OnDidManualLoadFail(); |
| 91 void OnInstallMissingPlugin(); | 87 void OnInstallMissingPlugin(); |
| 92 | 88 |
| 93 void OnHandleURLRequestReply( | 89 void OnHandleURLRequestReply( |
| 94 const PluginMsg_URLRequestReply_Params& params); | 90 const PluginMsg_URLRequestReply_Params& params); |
| 95 | 91 |
| 96 void CreateSharedBuffer(size_t size, | 92 void CreateSharedBuffer(size_t size, |
| 97 base::SharedMemory* shared_buf, | 93 base::SharedMemory* shared_buf, |
| 98 base::SharedMemoryHandle* remote_handle); | 94 base::SharedMemoryHandle* remote_handle); |
| 99 | 95 |
| 100 std::string mime_type_; | 96 std::string mime_type_; |
| 101 int instance_id_; | 97 int instance_id_; |
| 102 | 98 |
| 103 scoped_refptr<PluginChannel> channel_; | 99 scoped_refptr<PluginChannel> channel_; |
| 104 | 100 |
| 105 webkit_glue::WebPluginDelegate* delegate_; | 101 WebPluginDelegateImpl* delegate_; |
| 106 WebPluginProxy* webplugin_; | 102 WebPluginProxy* webplugin_; |
| 107 | 103 |
| 108 // The url of the main frame hosting the plugin. | 104 // The url of the main frame hosting the plugin. |
| 109 GURL page_url_; | 105 GURL page_url_; |
| 110 | 106 |
| 111 DISALLOW_IMPLICIT_CONSTRUCTORS(WebPluginDelegateStub); | 107 DISALLOW_IMPLICIT_CONSTRUCTORS(WebPluginDelegateStub); |
| 112 }; | 108 }; |
| 113 | 109 |
| 114 #endif // CHROME_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ | 110 #endif // CHROME_PLUGIN_WEBPLUGIN_DELEGATE_STUB_H_ |
| OLD | NEW |