| 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_PLUGINS_NPAPI_PLUGIN_GROUP_H_ |
| 6 #define WEBKIT_PLUGINS_NPAPI_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> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // It contains all WebPluginInfo structs (at least one) matching its definition. | 71 // It contains all WebPluginInfo structs (at least one) matching its definition. |
| 72 // In addition, it knows about a security "baseline", i.e. the minimum version | 72 // In addition, it knows about a security "baseline", i.e. the minimum version |
| 73 // of a plugin that is needed in order not to exhibit known security | 73 // of a plugin that is needed in order not to exhibit known security |
| 74 // vulnerabilities. | 74 // vulnerabilities. |
| 75 | 75 |
| 76 class PluginGroup { | 76 class PluginGroup { |
| 77 public: | 77 public: |
| 78 // Used by about:plugins to disable Reader plugin when internal PDF viewer is | 78 // Used by about:plugins to disable Reader plugin when internal PDF viewer is |
| 79 // enabled. | 79 // enabled. |
| 80 static const char* kAdobeReaderGroupName; | 80 static const char* kAdobeReaderGroupName; |
| 81 static const char* kAdobeReaderUpdateURL; |
| 81 | 82 |
| 82 PluginGroup(const PluginGroup& other); | 83 PluginGroup(const PluginGroup& other); |
| 83 | 84 |
| 84 ~PluginGroup(); | 85 ~PluginGroup(); |
| 85 | 86 |
| 86 PluginGroup& operator=(const PluginGroup& other); | 87 PluginGroup& operator=(const PluginGroup& other); |
| 87 | 88 |
| 88 // Configures the set of plugin name patterns for disabling plugins via | 89 // Configures the set of plugin name patterns for disabling plugins via |
| 89 // enterprise configuration management. | 90 // enterprise configuration management. |
| 90 static void SetPolicyDisabledPluginPatterns(const std::set<string16>& set); | 91 static void SetPolicyDisabledPluginPatterns(const std::set<string16>& set); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 bool IsVulnerable() const; | 139 bool IsVulnerable() const; |
| 139 | 140 |
| 140 // Disables all plugins in this group that are older than the | 141 // Disables all plugins in this group that are older than the |
| 141 // minimum version. | 142 // minimum version. |
| 142 void DisableOutdatedPlugins(); | 143 void DisableOutdatedPlugins(); |
| 143 | 144 |
| 144 // Parse a version string as used by a plug-in. This method is more lenient | 145 // Parse a version string as used by a plug-in. This method is more lenient |
| 145 // in accepting weird version strings than Version::GetFromString(). | 146 // in accepting weird version strings than Version::GetFromString(). |
| 146 static Version* CreateVersionFromString(const string16& version_string); | 147 static Version* CreateVersionFromString(const string16& version_string); |
| 147 | 148 |
| 149 std::vector<WebPluginInfo> web_plugin_infos() { return web_plugin_infos_; } |
| 150 |
| 148 private: | 151 private: |
| 149 typedef std::map<std::string, PluginGroup*> PluginMap; | 152 typedef std::map<std::string, PluginGroup*> PluginMap; |
| 150 | 153 |
| 151 friend class PluginList; | 154 friend class PluginList; |
| 152 friend class PluginGroupTest; | 155 friend class PluginGroupTest; |
| 153 friend class ::TableModelArrayControllerTest; | 156 friend class ::TableModelArrayControllerTest; |
| 154 friend class ::PluginExceptionsTableModelTest; | 157 friend class ::PluginExceptionsTableModelTest; |
| 155 | 158 |
| 156 // Generates the (short) identifier string for the given plugin. | 159 // Generates the (short) identifier string for the given plugin. |
| 157 static std::string GetIdentifier(const WebPluginInfo& wpi); | 160 static std::string GetIdentifier(const WebPluginInfo& wpi); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 std::vector<VersionRange> version_ranges_; | 207 std::vector<VersionRange> version_ranges_; |
| 205 scoped_ptr<Version> version_; | 208 scoped_ptr<Version> version_; |
| 206 std::vector<WebPluginInfo> web_plugin_infos_; | 209 std::vector<WebPluginInfo> web_plugin_infos_; |
| 207 std::vector<int> web_plugin_positions_; | 210 std::vector<int> web_plugin_positions_; |
| 208 }; | 211 }; |
| 209 | 212 |
| 210 } // namespace npapi | 213 } // namespace npapi |
| 211 } // namespace webkit | 214 } // namespace webkit |
| 212 | 215 |
| 213 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ | 216 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ |
| OLD | NEW |