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_GLUE_PLUGINS_PLUGIN_GROUP_H_ | 5 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ |
6 #define WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ | 6 #define WEBKIT_PLUGINS_NPAPI_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 Version; | 20 class Version; |
| 21 |
| 22 namespace webkit { |
| 23 namespace npapi { |
| 24 |
| 25 class PluginList; |
21 struct WebPluginInfo; | 26 struct WebPluginInfo; |
22 | 27 |
23 namespace NPAPI { | |
24 class PluginList; | |
25 }; | |
26 | |
27 // Hard-coded version ranges for plugin groups. | 28 // Hard-coded version ranges for plugin groups. |
28 struct VersionRangeDefinition { | 29 struct VersionRangeDefinition { |
29 // Matcher for lowest version matched by this range (inclusive). May be empty | 30 // Matcher for lowest version matched by this range (inclusive). May be empty |
30 // to match everything iff |version_matcher_high| is also empty. | 31 // to match everything iff |version_matcher_high| is also empty. |
31 const char* version_matcher_low; | 32 const char* version_matcher_low; |
32 // Matcher for highest version matched by this range (exclusive). May be empty | 33 // Matcher for highest version matched by this range (exclusive). May be empty |
33 // to match anything higher than |version_matcher_low|. | 34 // to match anything higher than |version_matcher_low|. |
34 const char* version_matcher_high; | 35 const char* version_matcher_high; |
35 const char* min_version; // Minimum secure version. | 36 const char* min_version; // Minimum secure version. |
36 }; | 37 }; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // minimum version. | 137 // minimum version. |
137 void DisableOutdatedPlugins(); | 138 void DisableOutdatedPlugins(); |
138 | 139 |
139 // Parse a version string as used by a plug-in. This method is more lenient | 140 // Parse a version string as used by a plug-in. This method is more lenient |
140 // in accepting weird version strings than Version::GetFromString(). | 141 // in accepting weird version strings than Version::GetFromString(). |
141 static Version* CreateVersionFromString(const string16& version_string); | 142 static Version* CreateVersionFromString(const string16& version_string); |
142 | 143 |
143 private: | 144 private: |
144 typedef std::map<std::string, PluginGroup*> PluginMap; | 145 typedef std::map<std::string, PluginGroup*> PluginMap; |
145 | 146 |
146 friend class NPAPI::PluginList; | 147 friend class PluginList; |
147 friend class PluginGroupTest; | 148 friend class PluginGroupTest; |
148 friend class TableModelArrayControllerTest; | 149 friend class TableModelArrayControllerTest; |
149 friend class PluginExceptionsTableModelTest; | 150 friend class PluginExceptionsTableModelTest; |
150 | 151 |
151 // Generates the (short) identifier string for the given plugin. | 152 // Generates the (short) identifier string for the given plugin. |
152 static std::string GetIdentifier(const WebPluginInfo& wpi); | 153 static std::string GetIdentifier(const WebPluginInfo& wpi); |
153 | 154 |
154 // Generates the long identifier (based on the full file path) for the given | 155 // Generates the long identifier (based on the full file path) for the given |
155 // plugin, to be called when the short identifier is not unique. | 156 // plugin, to be called when the short identifier is not unique. |
156 static std::string GetLongIdentifier(const WebPluginInfo& wpi); | 157 static std::string GetLongIdentifier(const WebPluginInfo& wpi); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 string16 name_matcher_; | 196 string16 name_matcher_; |
196 string16 description_; | 197 string16 description_; |
197 std::string update_url_; | 198 std::string update_url_; |
198 bool enabled_; | 199 bool enabled_; |
199 std::vector<VersionRange> version_ranges_; | 200 std::vector<VersionRange> version_ranges_; |
200 scoped_ptr<Version> version_; | 201 scoped_ptr<Version> version_; |
201 std::vector<WebPluginInfo> web_plugin_infos_; | 202 std::vector<WebPluginInfo> web_plugin_infos_; |
202 std::vector<int> web_plugin_positions_; | 203 std::vector<int> web_plugin_positions_; |
203 }; | 204 }; |
204 | 205 |
205 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ | 206 } // namespace npapi |
| 207 } // namespace webkit |
| 208 |
| 209 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ |
OLD | NEW |