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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 | 91 |
92 // Tests to see if a plugin is on the blacklist using its path as | 92 // Tests to see if a plugin is on the blacklist using its path as |
93 // the lookup key. | 93 // the lookup key. |
94 static bool IsPluginPathDisabledByPolicy(const FilePath& plugin_path); | 94 static bool IsPluginPathDisabledByPolicy(const FilePath& plugin_path); |
95 | 95 |
96 // Returns true if the given plugin matches this group. | 96 // Returns true if the given plugin matches this group. |
97 bool Match(const WebPluginInfo& plugin) const; | 97 bool Match(const WebPluginInfo& plugin) const; |
98 | 98 |
99 // Adds the given plugin to this group. Provide the position of the | 99 // Adds the given plugin to this group. Provide the position of the |
100 // plugin as given by PluginList so we can display its priority. | 100 // plugin as given by PluginList so we can display its priority. |
101 void AddPlugin(const WebPluginInfo& plugin, int position); | 101 // Retuns true if plugin has been added and false if it was already added. |
| 102 bool AddPlugin(const WebPluginInfo& plugin, int position); |
| 103 |
| 104 // Returns a poitner to the plugin at the end of the |web_plugin_infos_| |
| 105 // array. |
| 106 std::vector<WebPluginInfo>& GetPlugins(); |
| 107 |
| 108 // Returns the positions of the plugins in the group. |
| 109 std::vector<int>& GetPluginPositions(); |
102 | 110 |
103 // Enables/disables this group. This enables/disables all plugins in the | 111 // Enables/disables this group. This enables/disables all plugins in the |
104 // group. | 112 // group. |
105 void Enable(bool enable); | 113 void Enable(bool enable); |
106 | 114 |
| 115 // Refreshes the enabled flag based on the state of its plugins. |
| 116 void RefreshEnabledState(); |
| 117 |
107 // Returns whether the plugin group is enabled or not. | 118 // Returns whether the plugin group is enabled or not. |
108 bool Enabled() const { return enabled_; } | 119 bool Enabled() const { return enabled_; } |
109 | 120 |
110 // Returns a unique identifier for this group, if one is defined, or the empty | 121 // Returns a unique identifier for this group, if one is defined, or the empty |
111 // string otherwise. | 122 // string otherwise. |
112 const std::string& identifier() const { return identifier_; } | 123 const std::string& identifier() const { return identifier_; } |
113 | 124 |
114 // Returns this group's name, or the filename without extension if the name | 125 // Returns this group's name, or the filename without extension if the name |
115 // is empty. | 126 // is empty. |
116 string16 GetGroupName() const; | 127 string16 GetGroupName() const; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 string16 description_; | 204 string16 description_; |
194 std::string update_url_; | 205 std::string update_url_; |
195 bool enabled_; | 206 bool enabled_; |
196 std::vector<VersionRange> version_ranges_; | 207 std::vector<VersionRange> version_ranges_; |
197 scoped_ptr<Version> version_; | 208 scoped_ptr<Version> version_; |
198 std::vector<WebPluginInfo> web_plugin_infos_; | 209 std::vector<WebPluginInfo> web_plugin_infos_; |
199 std::vector<int> web_plugin_positions_; | 210 std::vector<int> web_plugin_positions_; |
200 }; | 211 }; |
201 | 212 |
202 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ | 213 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ |
OLD | NEW |