Index: webkit/glue/plugins/webplugininfo.h |
diff --git a/webkit/glue/plugins/webplugininfo.h b/webkit/glue/plugins/webplugininfo.h |
index 34eff3d5ae9d2ae6910d7104e95438547e3c4fa8..166b73bc47882b14f5b2649c56015ccece42e26f 100644 |
--- a/webkit/glue/plugins/webplugininfo.h |
+++ b/webkit/glue/plugins/webplugininfo.h |
@@ -2,8 +2,8 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef WEBKIT_GLUE_WEBPLUGININFO_H_ |
-#define WEBKIT_GLUE_WEBPLUGININFO_H_ |
+#ifndef WEBKIT_GLUE_PLUGINS_WEBPLUGININFO_H_ |
+#define WEBKIT_GLUE_PLUGINS_WEBPLUGININFO_H_ |
#include <string> |
#include <vector> |
@@ -35,9 +35,34 @@ struct WebPluginInfo { |
// Special constructor only used during unit testing: |
WebPluginInfo(const string16& fake_name, |
+ const FilePath& fake_path, |
const string16& fake_version, |
const string16& fake_desc); |
+ |
+ // Enables the plugin if not already enabled and if policy allows it to. |
+ // Returns true on success. |
+ bool Enable(int reason); |
jam
2010/12/17 19:14:45
please use an enum instead of a reason, that way y
pastarmovj
2010/12/20 19:57:37
Done.
|
+ |
+ // Disables the plugin if not already disabled and if policy allows it to. |
+ // Returns true on success. |
+ bool Disable(int reason); |
+ |
+ bool IsEnabled() const { return enabled; } |
+ static bool IsManaged(int reason) { return (reason & MANAGED) != 0; } |
+ bool HasVersion() const { return version.length() != 0; } |
+ |
+ // Returns true if the plugin supports "mime-type". |mime_type| should be all |
Bernhard Bauer
2010/12/17 18:50:59
Nit: Why the quotes?
pastarmovj
2010/12/20 19:57:37
Done.
|
+ // lower case. |
+ bool SupportsType(const std::string& mime_type, bool allow_wildcard) const; |
+ |
+ // Returns true if the given plugin supports a given file extension. |
+ // |extension| should be all lower case. If |mime_type| is not NULL, it will |
+ // be set to the mime type if found. The mime type which corresponds to the |
Bernhard Bauer
2010/12/17 18:50:59
Mini-nit: "MIME type" is usually written in caps,
pastarmovj
2010/12/20 19:57:37
Done.
|
+ // extension is optionally returned back. |
+ bool SupportsExtension(const std::string& extension, |
+ std::string* actual_mime_type) const; |
+ |
// The name of the plugin (i.e. Flash). |
string16 name; |
@@ -55,6 +80,16 @@ struct WebPluginInfo { |
// Whether the plugin is enabled. |
bool enabled; |
+ |
+ // Reason for the plugin being either enabled or disabled. |
+ int reason; |
Bernhard Bauer
2010/12/17 18:50:59
If you add a new field to WebPluginInfo, you shoul
pastarmovj
2010/12/20 19:57:37
Done.
|
+ |
+ // Constants definig bit fields in the reason member. |
Bernhard Bauer
2010/12/17 18:50:59
Nit: defining
pastarmovj
2010/12/20 19:57:37
Removed anyhow
|
+ static const int USER; |
+ static const int MANAGED; |
jam
2010/12/17 19:14:45
nit: the meaning of managed is a little cryptic.
pastarmovj
2010/12/20 19:57:37
Managed is the name used in the policy world to id
|
+ |
+ // Priority of the plugin (obsolete?) |
Bernhard Bauer
2010/12/17 18:50:59
At least it shouldn't be here. The priority is not
|
+ int priority; |
jam
2010/12/17 19:14:45
i think the order of plugins in a plugin group sho
Bernhard Bauer
2010/12/17 19:26:40
The order inside a group is probably not sufficien
pastarmovj
2010/12/20 19:57:37
We could only think of one synthetic case where or
jam
2010/12/20 20:56:59
I'm really against having this concept of order be
jam
2010/12/20 21:01:42
one more thing: if you add a is_placeholder, then
pastarmovj
2010/12/20 21:47:22
The order the array of plugins that existed before
jam
2010/12/21 19:57:42
why is this needed in PluginGroup? I really don't
|
}; |
-#endif // WEBKIT_GLUE_WEBPLUGININFO_H_ |
+#endif // WEBKIT_GLUE_PLUGINS_WEBPLUGININFO_H_ |