| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_GLUE_WEBPLUGIN_H_ | 5 #ifndef WEBKIT_GLUE_WEBPLUGIN_H_ |
| 6 #define WEBKIT_GLUE_WEBPLUGIN_H_ | 6 #define WEBKIT_GLUE_WEBPLUGIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Called by the plugin delegate to let it know that the window is being | 60 // Called by the plugin delegate to let it know that the window is being |
| 61 // destroyed. | 61 // destroyed. |
| 62 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) = 0; | 62 virtual void WillDestroyWindow(gfx::PluginWindowHandle window) = 0; |
| 63 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
| 64 // The pump_messages_event is a event handle which is valid only for | 64 // The pump_messages_event is a event handle which is valid only for |
| 65 // windowless plugins and is used in NPP_HandleEvent calls to pump messages | 65 // windowless plugins and is used in NPP_HandleEvent calls to pump messages |
| 66 // if the plugin enters a modal loop. | 66 // if the plugin enters a modal loop. |
| 67 // Cancels a pending request. | 67 // Cancels a pending request. |
| 68 virtual void SetWindowlessPumpEvent(HANDLE pump_messages_event) = 0; | 68 virtual void SetWindowlessPumpEvent(HANDLE pump_messages_event) = 0; |
| 69 #endif | 69 #endif |
| 70 virtual void CancelResource(int id) = 0; | 70 virtual void CancelResource(unsigned long id) = 0; |
| 71 virtual void Invalidate() = 0; | 71 virtual void Invalidate() = 0; |
| 72 virtual void InvalidateRect(const gfx::Rect& rect) = 0; | 72 virtual void InvalidateRect(const gfx::Rect& rect) = 0; |
| 73 | 73 |
| 74 // Returns the NPObject for the browser's window object. | 74 // Returns the NPObject for the browser's window object. |
| 75 virtual NPObject* GetWindowScriptNPObject() = 0; | 75 virtual NPObject* GetWindowScriptNPObject() = 0; |
| 76 | 76 |
| 77 // Returns the DOM element that loaded the plugin. | 77 // Returns the DOM element that loaded the plugin. |
| 78 virtual NPObject* GetPluginElement() = 0; | 78 virtual NPObject* GetPluginElement() = 0; |
| 79 | 79 |
| 80 // Cookies | 80 // Cookies |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 // Returns true iff in off the record (Incognito) mode. | 119 // Returns true iff in off the record (Incognito) mode. |
| 120 virtual bool IsOffTheRecord() = 0; | 120 virtual bool IsOffTheRecord() = 0; |
| 121 | 121 |
| 122 // Called when the WebPluginResourceClient instance is deleted. | 122 // Called when the WebPluginResourceClient instance is deleted. |
| 123 virtual void ResourceClientDeleted( | 123 virtual void ResourceClientDeleted( |
| 124 WebPluginResourceClient* resource_client) {} | 124 WebPluginResourceClient* resource_client) {} |
| 125 | 125 |
| 126 // Defers the loading of the resource identified by resource_id. This is | 126 // Defers the loading of the resource identified by resource_id. This is |
| 127 // controlled by the defer parameter. | 127 // controlled by the defer parameter. |
| 128 virtual void SetDeferResourceLoading(int resource_id, bool defer) = 0; | 128 virtual void SetDeferResourceLoading(unsigned long resource_id, |
| 129 bool defer) = 0; |
| 129 | 130 |
| 130 // Gets the WebPluginDelegate that implements the interface. | 131 // Gets the WebPluginDelegate that implements the interface. |
| 131 // This API is only for use with Pepper, and hence only with | 132 // This API is only for use with Pepper, and hence only with |
| 132 // in renderer process plugins. | 133 // in renderer process plugins. |
| 133 virtual WebPluginDelegate* delegate() { return NULL; } | 134 virtual WebPluginDelegate* delegate() { return NULL; } |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 // Simpler version of ResourceHandleClient that lends itself to proxying. | 137 // Simpler version of ResourceHandleClient that lends itself to proxying. |
| 137 class WebPluginResourceClient { | 138 class WebPluginResourceClient { |
| 138 public: | 139 public: |
| 139 virtual ~WebPluginResourceClient() {} | 140 virtual ~WebPluginResourceClient() {} |
| 140 virtual void WillSendRequest(const GURL& url) = 0; | 141 virtual void WillSendRequest(const GURL& url) = 0; |
| 141 // The request_is_seekable parameter indicates whether byte range requests | 142 // The request_is_seekable parameter indicates whether byte range requests |
| 142 // can be issued for the underlying stream. | 143 // can be issued for the underlying stream. |
| 143 virtual void DidReceiveResponse(const std::string& mime_type, | 144 virtual void DidReceiveResponse(const std::string& mime_type, |
| 144 const std::string& headers, | 145 const std::string& headers, |
| 145 uint32 expected_length, | 146 uint32 expected_length, |
| 146 uint32 last_modified, | 147 uint32 last_modified, |
| 147 bool request_is_seekable) = 0; | 148 bool request_is_seekable) = 0; |
| 148 virtual void DidReceiveData(const char* buffer, int length, | 149 virtual void DidReceiveData(const char* buffer, int length, |
| 149 int data_offset) = 0; | 150 int data_offset) = 0; |
| 150 virtual void DidFinishLoading() = 0; | 151 virtual void DidFinishLoading() = 0; |
| 151 virtual void DidFail() = 0; | 152 virtual void DidFail() = 0; |
| 152 virtual bool IsMultiByteResponseExpected() = 0; | 153 virtual bool IsMultiByteResponseExpected() = 0; |
| 153 }; | 154 }; |
| 154 | 155 |
| 155 } // namespace webkit_glue | 156 } // namespace webkit_glue |
| 156 | 157 |
| 157 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_H_ | 158 #endif // #ifndef WEBKIT_GLUE_WEBPLUGIN_H_ |
| OLD | NEW |