| 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 | |
| 98 // The result, UTF-8 encoded, of the script execution is returned via this | |
| 99 // function. | |
| 100 virtual void SendJavaScriptStream(const GURL& url, | |
| 101 const std::string& result, | |
| 102 bool success, | |
| 103 int notify_id) = 0; | |
| 104 | |
| 105 // Receives notification about data being available. | |
| 106 virtual void DidReceiveManualResponse(const GURL& url, | |
| 107 const std::string& mime_type, | |
| 108 const std::string& headers, | |
| 109 uint32 expected_length, | |
| 110 uint32 last_modified) = 0; | |
| 111 | |
| 112 // Receives the data. | |
| 113 virtual void DidReceiveManualData(const char* buffer, int length) = 0; | |
| 114 | |
| 115 // Indicates end of data load. | |
| 116 virtual void DidFinishManualLoading() = 0; | |
| 117 | |
| 118 // Indicates a failure in data receipt. | |
| 119 virtual void DidManualLoadFail() = 0; | |
| 120 | |
| 121 // Creates a WebPluginResourceClient instance and returns the same. | |
| 122 virtual WebPluginResourceClient* CreateResourceClient( | |
| 123 unsigned long resource_id, | |
| 124 const GURL& url, | |
| 125 int notify_id) = 0; | |
| 126 | |
| 127 // Creates a WebPluginResourceClient instance for an existing stream that is | |
| 128 // has become seekable. | |
| 129 virtual WebPluginResourceClient* CreateSeekableResourceClient( | |
| 130 unsigned long resource_id, int range_request_id) = 0; | |
| 131 | |
| 132 // 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 | |
| 134 // end up being routed to another frame or being a javscript:// URL. | |
| 135 virtual void FetchURL(unsigned long resource_id, | |
| 136 int notify_id, | |
| 137 const GURL& url, | |
| 138 const GURL& first_party_for_cookies, | |
| 139 const std::string& method, | |
| 140 const char* buf, | |
| 141 unsigned int len, | |
| 142 const Referrer& referrer, | |
| 143 bool notify_redirects, | |
| 144 bool is_plugin_src_load, | |
| 145 int origin_pid, | |
| 146 int render_frame_id, | |
| 147 int render_view_id) = 0; | |
| 148 | |
| 149 }; | 92 }; |
| 150 | 93 |
| 151 } // namespace content | 94 } // namespace content |
| 152 | 95 |
| 153 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ | 96 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
| OLD | NEW |