| 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 // TODO: Need to deal with NPAPI's NPSavedData. | 5 // TODO: Need to deal with NPAPI's NPSavedData. |
| 6 // I haven't seen plugins use it yet. | 6 // I haven't seen plugins use it yet. |
| 7 | 7 |
| 8 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ | 8 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ |
| 9 #define WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ | 9 #define WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 #include <stack> | 13 #include <stack> |
| 14 | 14 |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/file_path.h" | 16 #include "base/file_path.h" |
| 17 #include "base/gfx/native_widget_types.h" | 17 #include "base/gfx/native_widget_types.h" |
| 18 #include "base/ref_counted.h" | 18 #include "base/ref_counted.h" |
| 19 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
| 20 #include "webkit/glue/plugins/nphostapi.h" | 20 #include "webkit/glue/plugins/nphostapi.h" |
| 21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
| 22 #include "third_party/npapi/bindings/npapi.h" | 22 #include "third_party/npapi/bindings/npapi.h" |
| 23 | 23 |
| 24 class MessageLoop; |
| 25 |
| 26 namespace webkit_glue { |
| 24 class WebPlugin; | 27 class WebPlugin; |
| 25 class MessageLoop; | 28 } |
| 26 | 29 |
| 27 namespace NPAPI | 30 namespace NPAPI |
| 28 { | 31 { |
| 29 class PluginLib; | 32 class PluginLib; |
| 30 class PluginHost; | 33 class PluginHost; |
| 31 class PluginStream; | 34 class PluginStream; |
| 32 class PluginStreamUrl; | 35 class PluginStreamUrl; |
| 33 class PluginDataStream; | 36 class PluginDataStream; |
| 34 class MozillaExtensionApi; | 37 class MozillaExtensionApi; |
| 35 | 38 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void set_windowless(bool value) { windowless_ = value; } | 84 void set_windowless(bool value) { windowless_ = value; } |
| 82 | 85 |
| 83 // Get/Set whether this instance is transparent. | 86 // Get/Set whether this instance is transparent. |
| 84 // This only applies to windowless plugins. Transparent | 87 // This only applies to windowless plugins. Transparent |
| 85 // plugins require that webkit paint the background. | 88 // plugins require that webkit paint the background. |
| 86 // Default is true. | 89 // Default is true. |
| 87 bool transparent() { return transparent_; } | 90 bool transparent() { return transparent_; } |
| 88 void set_transparent(bool value) { transparent_ = value; } | 91 void set_transparent(bool value) { transparent_ = value; } |
| 89 | 92 |
| 90 // Get/Set the WebPlugin associated with this instance | 93 // Get/Set the WebPlugin associated with this instance |
| 91 WebPlugin* webplugin() { return webplugin_; } | 94 webkit_glue::WebPlugin* webplugin() { return webplugin_; } |
| 92 void set_web_plugin(WebPlugin* webplugin) { webplugin_ = webplugin; } | 95 void set_web_plugin(webkit_glue::WebPlugin* webplugin) { |
| 96 webplugin_ = webplugin; |
| 97 } |
| 93 | 98 |
| 94 // Get the mimeType for this plugin stream | 99 // Get the mimeType for this plugin stream |
| 95 const std::string &mime_type() { return mime_type_; } | 100 const std::string &mime_type() { return mime_type_; } |
| 96 | 101 |
| 97 NPAPI::PluginLib* plugin_lib() { return plugin_; } | 102 NPAPI::PluginLib* plugin_lib() { return plugin_; } |
| 98 | 103 |
| 99 #if defined(OS_WIN) | 104 #if defined(OS_WIN) |
| 100 // Handles a windows native message which this PluginInstance should deal | 105 // Handles a windows native message which this PluginInstance should deal |
| 101 // with. Returns true if the event is handled, false otherwise. | 106 // with. Returns true if the event is handled, false otherwise. |
| 102 bool HandleEvent(UINT message, WPARAM wParam, LPARAM lParam); | 107 bool HandleEvent(UINT message, WPARAM wParam, LPARAM lParam); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // could also log a bug with Real, which would save the effort. | 223 // could also log a bug with Real, which would save the effort. |
| 219 uint8 zero_padding_[96]; | 224 uint8 zero_padding_[96]; |
| 220 scoped_refptr<NPAPI::PluginLib> plugin_; | 225 scoped_refptr<NPAPI::PluginLib> plugin_; |
| 221 NPP npp_; | 226 NPP npp_; |
| 222 scoped_refptr<PluginHost> host_; | 227 scoped_refptr<PluginHost> host_; |
| 223 NPPluginFuncs* npp_functions_; | 228 NPPluginFuncs* npp_functions_; |
| 224 std::vector<scoped_refptr<PluginStream> > open_streams_; | 229 std::vector<scoped_refptr<PluginStream> > open_streams_; |
| 225 gfx::PluginWindowHandle window_handle_; | 230 gfx::PluginWindowHandle window_handle_; |
| 226 bool windowless_; | 231 bool windowless_; |
| 227 bool transparent_; | 232 bool transparent_; |
| 228 WebPlugin* webplugin_; | 233 webkit_glue::WebPlugin* webplugin_; |
| 229 std::string mime_type_; | 234 std::string mime_type_; |
| 230 GURL get_url_; | 235 GURL get_url_; |
| 231 intptr_t get_notify_data_; | 236 intptr_t get_notify_data_; |
| 232 bool use_mozilla_user_agent_; | 237 bool use_mozilla_user_agent_; |
| 233 #if defined(OS_WIN) | 238 #if defined(OS_WIN) |
| 234 scoped_refptr<MozillaExtensionApi> mozilla_extenstions_; | 239 scoped_refptr<MozillaExtensionApi> mozilla_extenstions_; |
| 235 #endif | 240 #endif |
| 236 MessageLoop* message_loop_; | 241 MessageLoop* message_loop_; |
| 237 scoped_refptr<PluginStreamUrl> plugin_data_stream_; | 242 scoped_refptr<PluginStreamUrl> plugin_data_stream_; |
| 238 | 243 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 250 // List of files created for the current plugin instance. File names are | 255 // List of files created for the current plugin instance. File names are |
| 251 // added to the list every time the NPP_StreamAsFile function is called. | 256 // added to the list every time the NPP_StreamAsFile function is called. |
| 252 std::vector<FilePath> files_created_; | 257 std::vector<FilePath> files_created_; |
| 253 | 258 |
| 254 DISALLOW_EVIL_CONSTRUCTORS(PluginInstance); | 259 DISALLOW_EVIL_CONSTRUCTORS(PluginInstance); |
| 255 }; | 260 }; |
| 256 | 261 |
| 257 } // namespace NPAPI | 262 } // namespace NPAPI |
| 258 | 263 |
| 259 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ | 264 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ |
| OLD | NEW |