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 WEBKIT_PLUGINS_WEBPLUGININFO_H_ | 5 #ifndef WEBKIT_PLUGINS_WEBPLUGININFO_H_ |
6 #define WEBKIT_PLUGINS_WEBPLUGININFO_H_ | 6 #define WEBKIT_PLUGINS_WEBPLUGININFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 | 13 |
| 14 namespace base { |
| 15 class Version; |
| 16 } |
| 17 |
14 namespace webkit { | 18 namespace webkit { |
15 | 19 |
16 struct WebPluginMimeType { | 20 struct WebPluginMimeType { |
17 WebPluginMimeType(); | 21 WebPluginMimeType(); |
18 // A constructor for the common case of a single file extension and an ASCII | 22 // A constructor for the common case of a single file extension and an ASCII |
19 // description. | 23 // description. |
20 WebPluginMimeType(const std::string& m, | 24 WebPluginMimeType(const std::string& m, |
21 const std::string& f, | 25 const std::string& f, |
22 const std::string& d); | 26 const std::string& d); |
23 ~WebPluginMimeType(); | 27 ~WebPluginMimeType(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const base::FilePath& fake_path, | 59 const base::FilePath& fake_path, |
56 const base::string16& fake_version, | 60 const base::string16& fake_version, |
57 const base::string16& fake_desc); | 61 const base::string16& fake_desc); |
58 | 62 |
59 bool is_pepper_plugin() const { | 63 bool is_pepper_plugin() const { |
60 return ((type == PLUGIN_TYPE_PEPPER_IN_PROCESS ) || | 64 return ((type == PLUGIN_TYPE_PEPPER_IN_PROCESS ) || |
61 (type == PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) || | 65 (type == PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) || |
62 (type == PLUGIN_TYPE_PEPPER_UNSANDBOXED)); | 66 (type == PLUGIN_TYPE_PEPPER_UNSANDBOXED)); |
63 } | 67 } |
64 | 68 |
| 69 // Parse a version string as used by a plug-in. This method is more lenient |
| 70 // in accepting weird version strings than base::Version::GetFromString() |
| 71 static void CreateVersionFromString(const base::string16& version_string, |
| 72 base::Version* parsed_version); |
| 73 |
65 // The name of the plugin (i.e. Flash). | 74 // The name of the plugin (i.e. Flash). |
66 base::string16 name; | 75 base::string16 name; |
67 | 76 |
68 // The path to the plugin file (DLL/bundle/library). | 77 // The path to the plugin file (DLL/bundle/library). |
69 base::FilePath path; | 78 base::FilePath path; |
70 | 79 |
71 // The version number of the plugin file (may be OS-specific) | 80 // The version number of the plugin file (may be OS-specific) |
72 base::string16 version; | 81 base::string16 version; |
73 | 82 |
74 // A description of the plugin that we get from its version info. | 83 // A description of the plugin that we get from its version info. |
75 base::string16 desc; | 84 base::string16 desc; |
76 | 85 |
77 // A list of all the mime types that this plugin supports. | 86 // A list of all the mime types that this plugin supports. |
78 std::vector<WebPluginMimeType> mime_types; | 87 std::vector<WebPluginMimeType> mime_types; |
79 | 88 |
80 // Plugin type. See the PluginType enum. | 89 // Plugin type. See the PluginType enum. |
81 int type; | 90 int type; |
82 | 91 |
83 // When type is PLUGIN_TYPE_PEPPER_* this indicates the permission bits. | 92 // When type is PLUGIN_TYPE_PEPPER_* this indicates the permission bits. |
84 int32 pepper_permissions; | 93 int32 pepper_permissions; |
85 }; | 94 }; |
86 | 95 |
87 } // namespace webkit | 96 } // namespace webkit |
88 | 97 |
89 #endif // WEBKIT_PLUGINS_WEBPLUGININFO_H_ | 98 #endif // WEBKIT_PLUGINS_WEBPLUGININFO_H_ |
OLD | NEW |