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 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_LIB_H__ | 5 #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_LIB_H__ |
6 #define WEBKIT_GLUE_PLUGIN_PLUGIN_LIB_H__ | 6 #define WEBKIT_GLUE_PLUGIN_PLUGIN_LIB_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Creates a new instance of this plugin. | 54 // Creates a new instance of this plugin. |
55 PluginInstance* CreateInstance(const std::string& mime_type); | 55 PluginInstance* CreateInstance(const std::string& mime_type); |
56 | 56 |
57 // Called by the instance when the instance is tearing down. | 57 // Called by the instance when the instance is tearing down. |
58 void CloseInstance(); | 58 void CloseInstance(); |
59 | 59 |
60 // Gets information about this plugin and the mime types that it | 60 // Gets information about this plugin and the mime types that it |
61 // supports. | 61 // supports. |
62 const WebPluginInfo& plugin_info() { return web_plugin_info_; } | 62 const WebPluginInfo& plugin_info() { return web_plugin_info_; } |
63 | 63 |
| 64 bool internal() { return internal_; } |
| 65 |
64 // | 66 // |
65 // NPAPI functions | 67 // NPAPI functions |
66 // | 68 // |
67 | 69 |
68 // NPAPI method to initialize a Plugin. | 70 // NPAPI method to initialize a Plugin. |
69 // Initialize can be safely called multiple times | 71 // Initialize can be safely called multiple times |
70 NPError NP_Initialize(); | 72 NPError NP_Initialize(); |
71 | 73 |
72 // NPAPI method to shutdown a Plugin. | 74 // NPAPI method to shutdown a Plugin. |
73 void NP_Shutdown(void); | 75 void NP_Shutdown(void); |
(...skipping 10 matching lines...) Expand all Loading... |
84 // Returns true if it is a legitimate plugin, false otherwise | 86 // Returns true if it is a legitimate plugin, false otherwise |
85 bool Load(); | 87 bool Load(); |
86 | 88 |
87 // Unloads the plugin library. | 89 // Unloads the plugin library. |
88 void Unload(); | 90 void Unload(); |
89 | 91 |
90 // Shutdown the plugin library. | 92 // Shutdown the plugin library. |
91 void Shutdown(); | 93 void Shutdown(); |
92 | 94 |
93 private: | 95 private: |
94 bool internal_; // Whether this an internal plugin. | 96 bool internal_; // True for plugins that are built-in into chrome binaries. |
95 WebPluginInfo web_plugin_info_; // supported mime types, description | 97 WebPluginInfo web_plugin_info_; // supported mime types, description |
96 base::NativeLibrary library_; // the opened library reference | 98 base::NativeLibrary library_; // the opened library reference |
97 NPPluginFuncs plugin_funcs_; // the struct of plugin side functions | 99 NPPluginFuncs plugin_funcs_; // the struct of plugin side functions |
98 bool initialized_; // is the plugin initialized | 100 bool initialized_; // is the plugin initialized |
99 NPSavedData *saved_data_; // persisted plugin info for NPAPI | 101 NPSavedData *saved_data_; // persisted plugin info for NPAPI |
100 int instance_count_; // count of plugins in use | 102 int instance_count_; // count of plugins in use |
101 | 103 |
102 // Function pointers to entry points into the plugin. | 104 // Function pointers to entry points into the plugin. |
103 PluginEntryPoints entry_points_; | 105 PluginEntryPoints entry_points_; |
104 | 106 |
105 DISALLOW_EVIL_CONSTRUCTORS(PluginLib); | 107 DISALLOW_EVIL_CONSTRUCTORS(PluginLib); |
106 }; | 108 }; |
107 | 109 |
108 } // namespace NPAPI | 110 } // namespace NPAPI |
109 | 111 |
110 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_LIB_H__ | 112 #endif // WEBKIT_GLUE_PLUGIN_PLUGIN_LIB_H__ |
OLD | NEW |