Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: webkit/glue/plugins/plugin_group.h

Issue 5699005: Policy: Re-enabled plugin still disabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Plugin reloading works completely now. Lint made happy as well. Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <list>
9 #include <map> 10 #include <map>
10 #include <set> 11 #include <set>
11 #include <string> 12 #include <string>
12 #include <vector> 13 #include <vector>
13 14
14 #include "base/gtest_prod_util.h" 15 #include "base/gtest_prod_util.h"
15 #include "base/scoped_ptr.h" 16 #include "base/scoped_ptr.h"
16 #include "base/string16.h" 17 #include "base/string16.h"
17 18
18 class DictionaryValue; 19 class DictionaryValue;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 // Tests to see if a plugin is on the blacklist using its path as 94 // Tests to see if a plugin is on the blacklist using its path as
94 // the lookup key. 95 // the lookup key.
95 static bool IsPluginPathDisabledByPolicy(const FilePath& plugin_path); 96 static bool IsPluginPathDisabledByPolicy(const FilePath& plugin_path);
96 97
97 // Returns true if the given plugin matches this group. 98 // Returns true if the given plugin matches this group.
98 bool Match(const WebPluginInfo& plugin) const; 99 bool Match(const WebPluginInfo& plugin) const;
99 100
100 // Adds the given plugin to this group. Provide the position of the 101 // Adds the given plugin to this group. Provide the position of the
101 // plugin as given by PluginList so we can display its priority. 102 // plugin as given by PluginList so we can display its priority.
102 void AddPlugin(const WebPluginInfo& plugin, int position); 103 // Retuns true if plugin has been added and false if it was already added.
104 bool AddPlugin(const WebPluginInfo& plugin,
105 int position,
106 WebPluginInfo** group_plugin_copy);
Bernhard Bauer 2010/12/15 17:23:45 Nit: Can you explain what |group_plugin_copy| is f
107
108 // Returns a poitner to the plugin at the end of the |web_plugin_infos_|
Bernhard Bauer 2010/12/15 17:23:45 Nit: Pointer. Also, it's a reference. Also, make i
109 // array.
110 std::list<WebPluginInfo>& GetPlugins();
111
112 // Returns the positions of the plugins in the group.
113 std::vector<int>& GetPluginPositions();
103 114
104 // Enables/disables this group. This enables/disables all plugins in the 115 // Enables/disables this group. This enables/disables all plugins in the
105 // group. 116 // group.
106 void Enable(bool enable); 117 void Enable(bool enable);
107 118
119 // Refreshes the enabled flag based on the state of its plugins.
120 void RefreshEnabledState();
121
108 // Returns whether the plugin group is enabled or not. 122 // Returns whether the plugin group is enabled or not.
109 bool Enabled() const { return enabled_; } 123 bool Enabled() const { return enabled_; }
110 124
111 // Returns a unique identifier for this group, if one is defined, or the empty 125 // Returns a unique identifier for this group, if one is defined, or the empty
112 // string otherwise. 126 // string otherwise.
113 const std::string& identifier() const { return identifier_; } 127 const std::string& identifier() const { return identifier_; }
114 128
115 // Returns this group's name, or the filename without extension if the name 129 // Returns this group's name, or the filename without extension if the name
116 // is empty. 130 // is empty.
117 string16 GetGroupName() const; 131 string16 GetGroupName() const;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 static std::set<string16>* policy_disabled_plugin_patterns_; 203 static std::set<string16>* policy_disabled_plugin_patterns_;
190 204
191 std::string identifier_; 205 std::string identifier_;
192 string16 group_name_; 206 string16 group_name_;
193 string16 name_matcher_; 207 string16 name_matcher_;
194 string16 description_; 208 string16 description_;
195 std::string update_url_; 209 std::string update_url_;
196 bool enabled_; 210 bool enabled_;
197 std::vector<VersionRange> version_ranges_; 211 std::vector<VersionRange> version_ranges_;
198 scoped_ptr<Version> version_; 212 scoped_ptr<Version> version_;
199 std::vector<WebPluginInfo> web_plugin_infos_; 213 std::list<WebPluginInfo> web_plugin_infos_;
jam 2010/12/15 19:48:55 I don't understand why this was changed into a lis
pastarmovj 2010/12/15 21:56:04 Because pointers to elements of a vector might get
200 std::vector<int> web_plugin_positions_; 214 std::vector<int> web_plugin_positions_;
201 }; 215 };
202 216
203 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_ 217 #endif // WEBKIT_GLUE_PLUGINS_PLUGIN_GROUP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698