| 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_GLUE_PLUGINS_PLUGIN_GROUP_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_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> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 std::string GetUpdateURL() const { return update_url_; } | 129 std::string GetUpdateURL() const { return update_url_; } |
| 130 | 130 |
| 131 // Returns true if the highest-priority plugin in this group has known | 131 // Returns true if the highest-priority plugin in this group has known |
| 132 // security problems. | 132 // security problems. |
| 133 bool IsVulnerable() const; | 133 bool IsVulnerable() const; |
| 134 | 134 |
| 135 // Disables all plugins in this group that are older than the | 135 // Disables all plugins in this group that are older than the |
| 136 // minimum version. | 136 // minimum version. |
| 137 void DisableOutdatedPlugins(); | 137 void DisableOutdatedPlugins(); |
| 138 | 138 |
| 139 // 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 static Version* CreateVersionFromString(const string16& version_string); |
| 142 |
| 139 private: | 143 private: |
| 140 FRIEND_TEST_ALL_PREFIXES(PluginGroupTest, PluginGroupDefinition); | 144 FRIEND_TEST_ALL_PREFIXES(PluginGroupTest, PluginGroupDefinition); |
| 141 | 145 |
| 142 static const PluginGroupDefinition* GetPluginGroupDefinitions(); | 146 static const PluginGroupDefinition* GetPluginGroupDefinitions(); |
| 143 static size_t GetPluginGroupDefinitionsSize(); | 147 static size_t GetPluginGroupDefinitionsSize(); |
| 144 | 148 |
| 145 PluginGroup(const string16& group_name, | 149 PluginGroup(const string16& group_name, |
| 146 const string16& name_matcher, | 150 const string16& name_matcher, |
| 147 const std::string& version_range_low, | 151 const std::string& version_range_low, |
| 148 const std::string& version_range_high, | 152 const std::string& version_range_high, |
| 149 const std::string& min_version, | 153 const std::string& min_version, |
| 150 const std::string& update_url, | 154 const std::string& update_url, |
| 151 const std::string& identifier); | 155 const std::string& identifier); |
| 152 | 156 |
| 153 Version* CreateVersionFromString(const string16& version_string); | |
| 154 | |
| 155 // Set the description and version for this plugin group from the | 157 // Set the description and version for this plugin group from the |
| 156 // given plug-in. | 158 // given plug-in. |
| 157 void UpdateDescriptionAndVersion(const WebPluginInfo& plugin); | 159 void UpdateDescriptionAndVersion(const WebPluginInfo& plugin); |
| 158 | 160 |
| 159 // Updates the active plugin in the group. The active plugin is the first | 161 // Updates the active plugin in the group. The active plugin is the first |
| 160 // enabled one, or if all plugins are disabled, simply the first one. | 162 // enabled one, or if all plugins are disabled, simply the first one. |
| 161 void UpdateActivePlugin(const WebPluginInfo& plugin); | 163 void UpdateActivePlugin(const WebPluginInfo& plugin); |
| 162 | 164 |
| 163 static std::set<string16>* policy_disabled_plugin_patterns_; | 165 static std::set<string16>* policy_disabled_plugin_patterns_; |
| 164 | 166 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 175 std::string min_version_str_; | 177 std::string min_version_str_; |
| 176 scoped_ptr<Version> min_version_; | 178 scoped_ptr<Version> min_version_; |
| 177 scoped_ptr<Version> version_; | 179 scoped_ptr<Version> version_; |
| 178 std::vector<WebPluginInfo> web_plugin_infos_; | 180 std::vector<WebPluginInfo> web_plugin_infos_; |
| 179 std::vector<int> web_plugin_positions_; | 181 std::vector<int> web_plugin_positions_; |
| 180 | 182 |
| 181 DISALLOW_COPY_AND_ASSIGN(PluginGroup); | 183 DISALLOW_COPY_AND_ASSIGN(PluginGroup); |
| 182 }; | 184 }; |
| 183 | 185 |
| 184 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ | 186 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ |
| OLD | NEW |