| 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_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
| 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ | 6 #define CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // Gets the NPObject associated with the plugin for scripting. | 80 // Gets the NPObject associated with the plugin for scripting. |
| 81 virtual NPObject* GetPluginScriptableObject() = 0; | 81 virtual NPObject* GetPluginScriptableObject() = 0; |
| 82 | 82 |
| 83 // Gets the NPP instance uniquely identifying the plugin for its lifetime. | 83 // Gets the NPP instance uniquely identifying the plugin for its lifetime. |
| 84 virtual struct _NPP* GetPluginNPP() = 0; | 84 virtual struct _NPP* GetPluginNPP() = 0; |
| 85 | 85 |
| 86 // Gets the form value associated with the plugin instance. | 86 // Gets the form value associated with the plugin instance. |
| 87 // Returns false if the value is not available. | 87 // Returns false if the value is not available. |
| 88 virtual bool GetFormValue(base::string16* value) = 0; | 88 virtual bool GetFormValue(base::string16* value) = 0; |
| 89 | 89 |
| 90 // Receives notification about a resource load that the plugin initiated | |
| 91 // for a frame. | |
| 92 virtual void DidFinishLoadWithReason(const GURL& url, NPReason reason, | |
| 93 int notify_id) = 0; | |
| 94 | |
| 95 // Returns the process id of the process that is running the plugin. | 90 // Returns the process id of the process that is running the plugin. |
| 96 virtual int GetProcessId() = 0; | 91 virtual int GetProcessId() = 0; |
| 97 | 92 |
| 98 // The result, UTF-8 encoded, of the script execution is returned via this | 93 // The result, UTF-8 encoded, of the script execution is returned via this |
| 99 // function. | 94 // function. |
| 100 virtual void SendJavaScriptStream(const GURL& url, | 95 virtual void SendJavaScriptStream(const GURL& url, |
| 101 const std::string& result, | 96 const std::string& result, |
| 102 bool success, | 97 bool success) = 0; |
| 103 int notify_id) = 0; | |
| 104 | 98 |
| 105 // Receives notification about data being available. | 99 // Receives notification about data being available. |
| 106 virtual void DidReceiveManualResponse(const GURL& url, | 100 virtual void DidReceiveManualResponse(const GURL& url, |
| 107 const std::string& mime_type, | 101 const std::string& mime_type, |
| 108 const std::string& headers, | 102 const std::string& headers, |
| 109 uint32 expected_length, | 103 uint32 expected_length, |
| 110 uint32 last_modified) = 0; | 104 uint32 last_modified) = 0; |
| 111 | 105 |
| 112 // Receives the data. | 106 // Receives the data. |
| 113 virtual void DidReceiveManualData(const char* buffer, int length) = 0; | 107 virtual void DidReceiveManualData(const char* buffer, int length) = 0; |
| 114 | 108 |
| 115 // Indicates end of data load. | 109 // Indicates end of data load. |
| 116 virtual void DidFinishManualLoading() = 0; | 110 virtual void DidFinishManualLoading() = 0; |
| 117 | 111 |
| 118 // Indicates a failure in data receipt. | 112 // Indicates a failure in data receipt. |
| 119 virtual void DidManualLoadFail() = 0; | 113 virtual void DidManualLoadFail() = 0; |
| 120 | 114 |
| 121 // Creates a WebPluginResourceClient instance and returns the same. | 115 // Creates a WebPluginResourceClient instance and returns the same. |
| 122 virtual WebPluginResourceClient* CreateResourceClient( | 116 virtual WebPluginResourceClient* CreateResourceClient( |
| 123 unsigned long resource_id, | 117 unsigned long resource_id, |
| 124 const GURL& url, | 118 const GURL& url) = 0; |
| 125 int notify_id) = 0; | |
| 126 | 119 |
| 127 // Creates a WebPluginResourceClient instance for an existing stream that is | 120 // Creates a WebPluginResourceClient instance for an existing stream that is |
| 128 // has become seekable. | 121 // has become seekable. |
| 129 virtual WebPluginResourceClient* CreateSeekableResourceClient( | 122 virtual WebPluginResourceClient* CreateSeekableResourceClient( |
| 130 unsigned long resource_id, int range_request_id) = 0; | 123 unsigned long resource_id, int range_request_id) = 0; |
| 131 | 124 |
| 132 // Tell the plugin that the given URL should be fetched. This is a result of | 125 // Tell the plugin that the given URL should be fetched. This is a result of |
| 133 // loading the plugin data or the plugin calling HandleURLRequest which didn't | 126 // loading the plugin data or the plugin calling HandleURLRequest which didn't |
| 134 // end up being routed to another frame or being a javscript:// URL. | 127 // end up being routed to another frame or being a javscript:// URL. |
| 135 virtual void FetchURL(unsigned long resource_id, | 128 virtual void FetchURL(unsigned long resource_id, |
| 136 int notify_id, | |
| 137 const GURL& url, | 129 const GURL& url, |
| 138 const GURL& first_party_for_cookies, | 130 const GURL& first_party_for_cookies, |
| 139 const std::string& method, | 131 const std::string& method, |
| 140 const char* buf, | 132 const char* buf, |
| 141 unsigned int len, | 133 unsigned int len, |
| 142 const Referrer& referrer, | 134 const Referrer& referrer, |
| 143 bool notify_redirects, | 135 bool notify_redirects, |
| 144 bool is_plugin_src_load, | 136 bool is_plugin_src_load, |
| 145 int origin_pid, | 137 int origin_pid, |
| 146 int render_frame_id, | 138 int render_frame_id, |
| 147 int render_view_id) = 0; | 139 int render_view_id) = 0; |
| 148 | 140 |
| 149 }; | 141 }; |
| 150 | 142 |
| 151 } // namespace content | 143 } // namespace content |
| 152 | 144 |
| 153 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ | 145 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
| OLD | NEW |