OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // is empty. | 78 // is empty. |
79 string16 GetGroupName() const; | 79 string16 GetGroupName() const; |
80 | 80 |
81 // Checks whether a plugin exists in the group with the given path. | 81 // Checks whether a plugin exists in the group with the given path. |
82 bool ContainsPlugin(const FilePath& path) const; | 82 bool ContainsPlugin(const FilePath& path) const; |
83 | 83 |
84 // Check if the group has no plugins. Could happen after a reload if the plug- | 84 // Check if the group has no plugins. Could happen after a reload if the plug- |
85 // in has disappeared from the pc (or in the process of updating). | 85 // in has disappeared from the pc (or in the process of updating). |
86 bool IsEmpty() const; | 86 bool IsEmpty() const; |
87 | 87 |
88 // Parse a version string as used by a plug-in. This method is more lenient | |
89 // in accepting weird version strings than Version::GetFromString(). | |
90 static void CreateVersionFromString(const string16& version_string, | |
91 Version* version); | |
92 | |
93 const std::vector<webkit::WebPluginInfo>& web_plugin_infos() const { | 88 const std::vector<webkit::WebPluginInfo>& web_plugin_infos() const { |
94 return web_plugin_infos_; | 89 return web_plugin_infos_; |
95 } | 90 } |
96 | 91 |
97 private: | 92 private: |
98 friend class MockPluginList; | 93 friend class MockPluginList; |
99 friend class PluginGroupTest; | 94 friend class PluginGroupTest; |
100 friend class PluginList; | 95 friend class PluginList; |
101 friend class ::PluginExceptionsTableModelTest; | 96 friend class ::PluginExceptionsTableModelTest; |
102 FRIEND_TEST_ALL_PREFIXES(PluginListTest, DisableOutdated); | 97 FRIEND_TEST_ALL_PREFIXES(PluginListTest, DisableOutdated); |
(...skipping 19 matching lines...) Expand all Loading... |
122 const std::string& identifier); | 117 const std::string& identifier); |
123 | 118 |
124 void InitFrom(const PluginGroup& other); | 119 void InitFrom(const PluginGroup& other); |
125 | 120 |
126 // Returns a non-const vector of all plugins in the group. This is only used | 121 // Returns a non-const vector of all plugins in the group. This is only used |
127 // by PluginList. | 122 // by PluginList. |
128 std::vector<webkit::WebPluginInfo>& GetPluginsContainer() { | 123 std::vector<webkit::WebPluginInfo>& GetPluginsContainer() { |
129 return web_plugin_infos_; | 124 return web_plugin_infos_; |
130 } | 125 } |
131 | 126 |
132 // Removes leading zeros from each of the components of a version string. | |
133 // The input version string should be in this format: XXX.YYY.ZZZ...etc. | |
134 static std::string RemoveLeadingZerosFromVersionComponents( | |
135 const std::string& version); | |
136 | |
137 std::string identifier_; | 127 std::string identifier_; |
138 string16 group_name_; | 128 string16 group_name_; |
139 string16 name_matcher_; | 129 string16 name_matcher_; |
140 std::vector<webkit::WebPluginInfo> web_plugin_infos_; | 130 std::vector<webkit::WebPluginInfo> web_plugin_infos_; |
141 }; | 131 }; |
142 | 132 |
143 } // namespace npapi | 133 } // namespace npapi |
144 } // namespace webkit | 134 } // namespace webkit |
145 | 135 |
146 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ | 136 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_GROUP_H_ |
OLD | NEW |