]> git.sesse.net Git - casparcg/blob - dependencies64/cef/include/cef_web_plugin.h
* Merged html producer and updated to latest CEF version (does not have satisfactory...
[casparcg] / dependencies64 / cef / include / cef_web_plugin.h
1 // Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // The contents of this file must follow a specific format in order to
33 // support the CEF translator tool. See the translator.README.txt file in the
34 // tools directory for more information.
35 //
36
37 #ifndef CEF_INCLUDE_CEF_WEB_PLUGIN_H_
38 #define CEF_INCLUDE_CEF_WEB_PLUGIN_H_
39
40 #include "include/cef_base.h"
41 #include "include/cef_browser.h"
42
43 ///
44 // Information about a specific web plugin.
45 ///
46 /*--cef(source=library)--*/
47 class CefWebPluginInfo : public virtual CefBase {
48  public:
49   ///
50   // Returns the plugin name (i.e. Flash).
51   ///
52   /*--cef()--*/
53   virtual CefString GetName() =0;
54
55   ///
56   // Returns the plugin file path (DLL/bundle/library).
57   ///
58   /*--cef()--*/
59   virtual CefString GetPath() =0;
60
61   ///
62   // Returns the version of the plugin (may be OS-specific).
63   ///
64   /*--cef()--*/
65   virtual CefString GetVersion() =0;
66
67   ///
68   // Returns a description of the plugin from the version information.
69   ///
70   /*--cef()--*/
71   virtual CefString GetDescription() =0;
72 };
73
74 ///
75 // Interface to implement for visiting web plugin information. The methods of
76 // this class will be called on the browser process UI thread.
77 ///
78 /*--cef(source=client)--*/
79 class CefWebPluginInfoVisitor : public virtual CefBase {
80  public:
81   ///
82   // Method that will be called once for each plugin. |count| is the 0-based
83   // index for the current plugin. |total| is the total number of plugins.
84   // Return false to stop visiting plugins. This method may never be called if
85   // no plugins are found.
86   ///
87   /*--cef()--*/
88   virtual bool Visit(CefRefPtr<CefWebPluginInfo> info, int count, int total) =0;
89 };
90
91 ///
92 // Visit web plugin information. Can be called on any thread in the browser
93 // process.
94 ///
95 /*--cef()--*/
96 void CefVisitWebPluginInfo(CefRefPtr<CefWebPluginInfoVisitor> visitor);
97
98 ///
99 // Cause the plugin list to refresh the next time it is accessed regardless
100 // of whether it has already been loaded. Can be called on any thread in the
101 // browser process.
102 ///
103 /*--cef()--*/
104 void CefRefreshWebPlugins();
105
106 ///
107 // Add a plugin path (directory + file). This change may not take affect until
108 // after CefRefreshWebPlugins() is called. Can be called on any thread in the
109 // browser process.
110 ///
111 /*--cef()--*/
112 void CefAddWebPluginPath(const CefString& path);
113
114 ///
115 // Add a plugin directory. This change may not take affect until after
116 // CefRefreshWebPlugins() is called. Can be called on any thread in the browser
117 // process.
118 ///
119 /*--cef()--*/
120 void CefAddWebPluginDirectory(const CefString& dir);
121
122 ///
123 // Remove a plugin path (directory + file). This change may not take affect
124 // until after CefRefreshWebPlugins() is called. Can be called on any thread in
125 // the browser process.
126 ///
127 /*--cef()--*/
128 void CefRemoveWebPluginPath(const CefString& path);
129
130 ///
131 // Unregister an internal plugin. This may be undone the next time
132 // CefRefreshWebPlugins() is called. Can be called on any thread in the browser
133 // process.
134 ///
135 /*--cef()--*/
136 void CefUnregisterInternalWebPlugin(const CefString& path);
137
138 ///
139 // Force a plugin to shutdown. Can be called on any thread in the browser
140 // process but will be executed on the IO thread.
141 ///
142 /*--cef()--*/
143 void CefForceWebPluginShutdown(const CefString& path);
144
145 ///
146 // Register a plugin crash. Can be called on any thread in the browser process
147 // but will be executed on the IO thread.
148 ///
149 /*--cef()--*/
150 void CefRegisterWebPluginCrash(const CefString& path);
151
152 ///
153 // Interface to implement for receiving unstable plugin information. The methods
154 // of this class will be called on the browser process IO thread.
155 ///
156 /*--cef(source=client)--*/
157 class CefWebPluginUnstableCallback : public virtual CefBase {
158  public:
159   ///
160   // Method that will be called for the requested plugin. |unstable| will be
161   // true if the plugin has reached the crash count threshold of 3 times in 120
162   // seconds.
163   ///
164   /*--cef()--*/
165   virtual void IsUnstable(const CefString& path,
166                           bool unstable) =0;
167 };
168
169 ///
170 // Query if a plugin is unstable. Can be called on any thread in the browser
171 // process.
172 ///
173 /*--cef()--*/
174 void CefIsWebPluginUnstable(const CefString& path,
175                             CefRefPtr<CefWebPluginUnstableCallback> callback);
176
177
178 #endif  // CEF_INCLUDE_CEF_WEB_PLUGIN_H_