| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 static const char* kAdobeReaderUpdateURL; |
| 82 // Some plug-ins, by default, need user authorization. These plug-ins have: |
| 83 // - A relatively large install base (>= 25%) |
| 84 // - A relatively low usage rate (~10% and below) |
| 85 // - Been targetted successfully by malware authors |
| 86 static const char* kJavaGroupName; |
| 87 static const char* kIcedTeaGroupName; |
| 88 static const char* kQuickTimeGroupName; |
| 89 static const char* kShockwaveGroupName; |
| 82 | 90 |
| 83 PluginGroup(const PluginGroup& other); | 91 PluginGroup(const PluginGroup& other); |
| 84 | 92 |
| 85 ~PluginGroup(); | 93 ~PluginGroup(); |
| 86 | 94 |
| 87 PluginGroup& operator=(const PluginGroup& other); | 95 PluginGroup& operator=(const PluginGroup& other); |
| 88 | 96 |
| 89 // Configures the set of plugin name patterns for disabling plugins via | 97 // Configures the set of plugin name patterns for disabling plugins via |
| 90 // enterprise configuration management. | 98 // enterprise configuration management. |
| 91 static void SetPolicyDisabledPluginPatterns(const std::set<string16>& set); | 99 static void SetPolicyDisabledPluginPatterns(const std::set<string16>& set); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Returns a DictionaryValue with data to save in the preferences. | 139 // Returns a DictionaryValue with data to save in the preferences. |
| 132 DictionaryValue* GetSummary() const; | 140 DictionaryValue* GetSummary() const; |
| 133 | 141 |
| 134 // Returns the update URL. | 142 // Returns the update URL. |
| 135 std::string GetUpdateURL() const { return update_url_; } | 143 std::string GetUpdateURL() const { return update_url_; } |
| 136 | 144 |
| 137 // Returns true if the highest-priority plugin in this group has known | 145 // Returns true if the highest-priority plugin in this group has known |
| 138 // security problems. | 146 // security problems. |
| 139 bool IsVulnerable() const; | 147 bool IsVulnerable() const; |
| 140 | 148 |
| 149 // Returns true if this plug-in group always requires user authorization |
| 150 // to run. |
| 151 bool RequiresAuthorization() const; |
| 152 |
| 141 // Disables all plugins in this group that are older than the | 153 // Disables all plugins in this group that are older than the |
| 142 // minimum version. | 154 // minimum version. |
| 143 void DisableOutdatedPlugins(); | 155 void DisableOutdatedPlugins(); |
| 144 | 156 |
| 145 // Parse a version string as used by a plug-in. This method is more lenient | 157 // Parse a version string as used by a plug-in. This method is more lenient |
| 146 // in accepting weird version strings than Version::GetFromString(). | 158 // in accepting weird version strings than Version::GetFromString(). |
| 147 static Version* CreateVersionFromString(const string16& version_string); | 159 static Version* CreateVersionFromString(const string16& version_string); |
| 148 | 160 |
| 149 std::vector<WebPluginInfo> web_plugin_infos() { return web_plugin_infos_; } | 161 std::vector<WebPluginInfo> web_plugin_infos() { return web_plugin_infos_; } |
| 150 | 162 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 std::vector<VersionRange> version_ranges_; | 219 std::vector<VersionRange> version_ranges_; |
| 208 scoped_ptr<Version> version_; | 220 scoped_ptr<Version> version_; |
| 209 std::vector<WebPluginInfo> web_plugin_infos_; | 221 std::vector<WebPluginInfo> web_plugin_infos_; |
| 210 std::vector<int> web_plugin_positions_; | 222 std::vector<int> web_plugin_positions_; |
| 211 }; | 223 }; |
| 212 | 224 |
| 213 } // namespace npapi | 225 } // namespace npapi |
| 214 } // namespace webkit | 226 } // namespace webkit |
| 215 | 227 |
| 216 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ | 228 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ |
| OLD | NEW |