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 10 matching lines...) Expand all Loading... |
21 namespace WebKit { | 21 namespace WebKit { |
22 class WebInputEvent; | 22 class WebInputEvent; |
23 } | 23 } |
24 | 24 |
25 namespace gfx { | 25 namespace gfx { |
26 class Rect; | 26 class Rect; |
27 } | 27 } |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 class WebPlugin; | |
32 class WebPluginResourceClient; | 31 class WebPluginResourceClient; |
33 | 32 |
34 // This is the interface that a plugin implementation needs to provide. | 33 // This is the interface that a plugin implementation needs to provide. |
35 class WebPluginDelegate { | 34 class WebPluginDelegate { |
36 public: | 35 public: |
37 virtual ~WebPluginDelegate() {} | 36 virtual ~WebPluginDelegate() {} |
38 | 37 |
39 // Initializes the plugin implementation with the given (UTF8) arguments. | 38 // Initializes the plugin implementation with the given (UTF8) arguments. |
40 // Note that the lifetime of WebPlugin must be longer than this delegate. | 39 // Note that the lifetime of WebPlugin must be longer than this delegate. |
41 // If this function returns false the plugin isn't started and shouldn't be | 40 // If this function returns false the plugin isn't started and shouldn't be |
42 // called again. If this method succeeds, then the WebPlugin is valid until | 41 // called again. If this method succeeds, then the WebPlugin is valid until |
43 // PluginDestroyed is called. | 42 // PluginDestroyed is called. |
44 // The load_manually parameter if true indicates that the plugin data would | 43 // The load_manually parameter if true indicates that the plugin data would |
45 // be passed from webkit. if false indicates that the plugin should download | 44 // be passed from webkit. if false indicates that the plugin should download |
46 // the data. This also controls whether the plugin is instantiated as a full | 45 // the data. This also controls whether the plugin is instantiated as a full |
47 // page plugin (NP_FULL) or embedded (NP_EMBED). | 46 // page plugin (NP_FULL) or embedded (NP_EMBED). |
48 virtual bool Initialize(const GURL& url, | 47 virtual bool Initialize(const GURL& url, |
49 const std::vector<std::string>& arg_names, | 48 const std::vector<std::string>& arg_names, |
50 const std::vector<std::string>& arg_values, | 49 const std::vector<std::string>& arg_values, |
51 WebPlugin* plugin, | |
52 bool load_manually) = 0; | 50 bool load_manually) = 0; |
53 | 51 |
54 // Called when the WebPlugin is being destroyed. This is a signal to the | 52 // Called when the WebPlugin is being destroyed. This is a signal to the |
55 // delegate that it should tear-down the plugin implementation and not call | 53 // delegate that it should tear-down the plugin implementation and not call |
56 // methods on the WebPlugin again. | 54 // methods on the WebPlugin again. |
57 virtual void PluginDestroyed() = 0; | 55 virtual void PluginDestroyed() = 0; |
58 | 56 |
59 // Update the geometry of the plugin. This is a request to move the | 57 // Update the geometry of the plugin. This is a request to move the |
60 // plugin, relative to its containing window, to the coords given by | 58 // plugin, relative to its containing window, to the coords given by |
61 // window_rect. Its contents should be clipped to the coords given | 59 // window_rect. Its contents should be clipped to the coords given |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // Creates a WebPluginResourceClient instance and returns the same. | 120 // Creates a WebPluginResourceClient instance and returns the same. |
123 virtual WebPluginResourceClient* CreateResourceClient( | 121 virtual WebPluginResourceClient* CreateResourceClient( |
124 unsigned long resource_id, | 122 unsigned long resource_id, |
125 const GURL& url, | 123 const GURL& url, |
126 int notify_id) = 0; | 124 int notify_id) = 0; |
127 | 125 |
128 // Creates a WebPluginResourceClient instance for an existing stream that is | 126 // Creates a WebPluginResourceClient instance for an existing stream that is |
129 // has become seekable. | 127 // has become seekable. |
130 virtual WebPluginResourceClient* CreateSeekableResourceClient( | 128 virtual WebPluginResourceClient* CreateSeekableResourceClient( |
131 unsigned long resource_id, int range_request_id) = 0; | 129 unsigned long resource_id, int range_request_id) = 0; |
| 130 |
| 131 // Tell the plugin that the given URL should be fetched. This is a result of |
| 132 // loading the plugin data or the plugin calling HandleURLRequest which didn't |
| 133 // end up being routed to another frame or being a javscript:// URL. |
| 134 virtual void FetchURL(unsigned long resource_id, |
| 135 int notify_id, |
| 136 const GURL& url, |
| 137 const GURL& first_party_for_cookies, |
| 138 const std::string& method, |
| 139 const std::string& post_data, |
| 140 const GURL& referrer, |
| 141 bool notify_redirects, |
| 142 bool is_plugin_src_load, |
| 143 int origin_pid, |
| 144 int render_view_id) = 0; |
| 145 |
132 }; | 146 }; |
133 | 147 |
134 } // namespace content | 148 } // namespace content |
135 | 149 |
136 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ | 150 #endif // CONTENT_CHILD_NPAPI_WEBPLUGIN_DELEGATE_H_ |
OLD | NEW |