OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_NPAPI_PLUGIN_GROUP_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
16 #include "base/string16.h" | 16 #include "base/string16.h" |
17 | 17 |
18 class DictionaryValue; | 18 class DictionaryValue; |
19 class FilePath; | 19 class FilePath; |
20 class TableModelArrayControllerTest; | |
21 class PluginExceptionsTableModelTest; | |
22 class Version; | 20 class Version; |
| 21 struct WebPluginInfo; |
23 | 22 |
24 namespace webkit { | 23 namespace NPAPI { |
25 namespace npapi { | |
26 | |
27 class PluginList; | 24 class PluginList; |
28 struct WebPluginInfo; | 25 }; |
29 | 26 |
30 // Hard-coded version ranges for plugin groups. | 27 // Hard-coded version ranges for plugin groups. |
31 struct VersionRangeDefinition { | 28 struct VersionRangeDefinition { |
32 // Matcher for lowest version matched by this range (inclusive). May be empty | 29 // Matcher for lowest version matched by this range (inclusive). May be empty |
33 // to match everything iff |version_matcher_high| is also empty. | 30 // to match everything iff |version_matcher_high| is also empty. |
34 const char* version_matcher_low; | 31 const char* version_matcher_low; |
35 // Matcher for highest version matched by this range (exclusive). May be empty | 32 // Matcher for highest version matched by this range (exclusive). May be empty |
36 // to match anything higher than |version_matcher_low|. | 33 // to match anything higher than |version_matcher_low|. |
37 const char* version_matcher_high; | 34 const char* version_matcher_high; |
38 const char* min_version; // Minimum secure version. | 35 const char* min_version; // Minimum secure version. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // minimum version. | 136 // minimum version. |
140 void DisableOutdatedPlugins(); | 137 void DisableOutdatedPlugins(); |
141 | 138 |
142 // Parse a version string as used by a plug-in. This method is more lenient | 139 // Parse a version string as used by a plug-in. This method is more lenient |
143 // in accepting weird version strings than Version::GetFromString(). | 140 // in accepting weird version strings than Version::GetFromString(). |
144 static Version* CreateVersionFromString(const string16& version_string); | 141 static Version* CreateVersionFromString(const string16& version_string); |
145 | 142 |
146 private: | 143 private: |
147 typedef std::map<std::string, PluginGroup*> PluginMap; | 144 typedef std::map<std::string, PluginGroup*> PluginMap; |
148 | 145 |
149 friend class PluginList; | 146 friend class NPAPI::PluginList; |
150 friend class PluginGroupTest; | 147 friend class PluginGroupTest; |
151 friend class ::TableModelArrayControllerTest; | 148 friend class TableModelArrayControllerTest; |
152 friend class ::PluginExceptionsTableModelTest; | 149 friend class PluginExceptionsTableModelTest; |
153 | 150 |
154 // Generates the (short) identifier string for the given plugin. | 151 // Generates the (short) identifier string for the given plugin. |
155 static std::string GetIdentifier(const WebPluginInfo& wpi); | 152 static std::string GetIdentifier(const WebPluginInfo& wpi); |
156 | 153 |
157 // Generates the long identifier (based on the full file path) for the given | 154 // Generates the long identifier (based on the full file path) for the given |
158 // plugin, to be called when the short identifier is not unique. | 155 // plugin, to be called when the short identifier is not unique. |
159 static std::string GetLongIdentifier(const WebPluginInfo& wpi); | 156 static std::string GetLongIdentifier(const WebPluginInfo& wpi); |
160 | 157 |
161 // Creates a PluginGroup from a PluginGroupDefinition. The caller takes | 158 // Creates a PluginGroup from a PluginGroupDefinition. The caller takes |
162 // ownership of the created PluginGroup. | 159 // ownership of the created PluginGroup. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 string16 name_matcher_; | 195 string16 name_matcher_; |
199 string16 description_; | 196 string16 description_; |
200 std::string update_url_; | 197 std::string update_url_; |
201 bool enabled_; | 198 bool enabled_; |
202 std::vector<VersionRange> version_ranges_; | 199 std::vector<VersionRange> version_ranges_; |
203 scoped_ptr<Version> version_; | 200 scoped_ptr<Version> version_; |
204 std::vector<WebPluginInfo> web_plugin_infos_; | 201 std::vector<WebPluginInfo> web_plugin_infos_; |
205 std::vector<int> web_plugin_positions_; | 202 std::vector<int> web_plugin_positions_; |
206 }; | 203 }; |
207 | 204 |
208 } // namespace npapi | 205 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ |
209 } // namespace webkit | |
210 | |
211 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ | |
OLD | NEW |