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 #include "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 << actual_mime_type << " (expected " << orig_mime_type | 46 << actual_mime_type << " (expected " << orig_mime_type |
47 << ")"; | 47 << ")"; |
48 return allow; | 48 return allow; |
49 } | 49 } |
50 | 50 |
51 } | 51 } |
52 | 52 |
53 namespace webkit { | 53 namespace webkit { |
54 namespace npapi { | 54 namespace npapi { |
55 | 55 |
| 56 // Note: If you change the plug-in definitions here, also update |
| 57 // chrome/browser/resources/plugins_*.json correspondingly! |
| 58 // In particular, the identifier and the update URLs need to be kept in sync. |
| 59 |
56 // Some version ranges can be shared across operating systems. This should be | 60 // Some version ranges can be shared across operating systems. This should be |
57 // done where possible to avoid duplication. | 61 // done where possible to avoid duplication. |
58 // TODO(bauerb): The |requires_authorization| flag should be part of | |
59 // PluginGroupDefinition, not VersionRangeDefinition. | |
60 static const VersionRangeDefinition kAllVersionsInfobarVersionRange[] = { | |
61 { "", "", "", true } | |
62 }; | |
63 | |
64 static const VersionRangeDefinition kAllVersionsNoInfobarVersionRange[] = { | |
65 { "", "", "", false } | |
66 }; | |
67 | 62 |
68 // This is up to date with | 63 // This is up to date with |
69 // http://www.adobe.com/support/security/bulletins/apsb12-03.html | 64 // http://www.adobe.com/support/security/bulletins/apsb12-03.html |
70 // NOTE: We would like to go to the 4th component value but we cannot because | 65 // NOTE: We would like to go to the 4th component value but we cannot because |
71 // on some platforms, such as Linux, it is not available. | 66 // on some platforms, such as Linux, it is not available. |
72 static const VersionRangeDefinition kFlashVersionRange[] = { | 67 static const VersionRangeDefinition kFlashVersionRange[] = { |
73 { "", "", "11.1.102", false } | 68 { "", "", "11.1.102" } |
74 }; | 69 }; |
75 // This is up to date with | 70 // This is up to date with |
76 // http://www.adobe.com/support/security/bulletins/apsb12-02.html | 71 // http://www.adobe.com/support/security/bulletins/apsb12-02.html |
77 static const VersionRangeDefinition kShockwaveVersionRange[] = { | 72 static const VersionRangeDefinition kShockwaveVersionRange[] = { |
78 { "", "", "11.6.4.634", true } | 73 { "", "", "11.6.4.634" } |
79 }; | 74 }; |
80 // This is up to date with | 75 // This is up to date with |
81 // http://support.microsoft.com/kb/2668562 | 76 // http://support.microsoft.com/kb/2668562 |
82 // http://technet.microsoft.com/en-us/security/Bulletin/MS12-016 | 77 // http://technet.microsoft.com/en-us/security/Bulletin/MS12-016 |
83 static const VersionRangeDefinition kSilverlightVersionRange[] = { | 78 static const VersionRangeDefinition kSilverlightVersionRange[] = { |
84 { "0", "5", "4.1.10111.0", false }, | 79 { "0", "5", "4.1.10111.0" }, |
85 { "5", "6", "", false }, | 80 { "5", "6", "" }, |
86 }; | 81 }; |
87 | 82 |
88 // Similarly, try and share the group definition for plug-ins that are | 83 // Similarly, try and share the group definition for plug-ins that are |
89 // very consistent across OS'es. | 84 // very consistent across OS'es. |
90 #define kFlashDefinition { \ | 85 #define kFlashDefinition { \ |
91 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange,\ | 86 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange,\ |
92 arraysize(kFlashVersionRange), "http://get.adobe.com/flashplayer/" } | 87 arraysize(kFlashVersionRange) } |
93 | 88 |
94 #define kShockwaveDefinition { \ | 89 #define kShockwaveDefinition { \ |
95 "shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \ | 90 "shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \ |
96 kShockwaveVersionRange, arraysize(kShockwaveVersionRange), \ | 91 kShockwaveVersionRange, arraysize(kShockwaveVersionRange) } |
97 "http://www.adobe.com/shockwave/download/" } | |
98 | 92 |
99 #define kSilverlightDefinition { \ | 93 #define kSilverlightDefinition { \ |
100 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ | 94 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ |
101 kSilverlightVersionRange, arraysize(kSilverlightVersionRange), \ | 95 kSilverlightVersionRange, arraysize(kSilverlightVersionRange) } |
102 "http://www.microsoft.com/getsilverlight/" } | |
103 | 96 |
104 #define kChromePdfDefinition { \ | 97 #define kChromePdfDefinition { \ |
105 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", \ | 98 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 } |
106 kAllVersionsNoInfobarVersionRange, \ | |
107 arraysize(kAllVersionsNoInfobarVersionRange), "" } | |
108 | 99 |
109 #define kGoogleTalkDefinition { \ | 100 #define kGoogleTalkDefinition { \ |
110 "google-talk", "Google Talk NPAPI Plugin", "Google Talk NPAPI Plugin", \ | 101 "google-talk", "Google Talk NPAPI Plugin", "Google Talk NPAPI Plugin",\ |
111 kAllVersionsNoInfobarVersionRange, \ | 102 NULL, 0 } |
112 arraysize(kAllVersionsNoInfobarVersionRange), ""} | |
113 | 103 |
114 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
115 // Plugin Groups for Mac. | 105 // Plugin Groups for Mac. |
116 // Plugins are listed here as soon as vulnerabilities and solutions | 106 // Plugins are listed here as soon as vulnerabilities and solutions |
117 // (new versions) are published. | 107 // (new versions) are published. |
118 static const VersionRangeDefinition kQuicktimeVersionRange[] = { | 108 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
119 { "", "", "7.6.6", true } | 109 { "", "", "7.6.6" } |
120 }; | 110 }; |
121 static const VersionRangeDefinition kJavaVersionRange[] = { | 111 static const VersionRangeDefinition kJavaVersionRange[] = { |
122 { "0", "13.0", "12.8.0", true }, // Leopard | 112 { "0", "13.0", "12.8.0" }, // Leopard |
123 { "13.0", "14.0", "13.5.0", true }, // Snow Leopard | 113 { "13.0", "14.0", "13.5.0" }, // Snow Leopard |
124 { "14.0", "", "14.0.3", true } // Lion | 114 { "14.0", "", "14.0.3" } // Lion |
125 }; | 115 }; |
126 static const VersionRangeDefinition kFlip4MacVersionRange[] = { | 116 static const VersionRangeDefinition kFlip4MacVersionRange[] = { |
127 { "", "", "2.2.1", true } | 117 { "", "", "2.2.1" } |
128 }; | |
129 static const VersionRangeDefinition kDivXVersionRange[] = { | |
130 { "", "", "", true } | |
131 }; | 118 }; |
132 // Note: The Adobe Reader browser plug-in is not supported in Chrome. | 119 // Note: The Adobe Reader browser plug-in is not supported in Chrome. |
133 // Note: The Real Player plugin for mac doesn't expose a version at all. | 120 // Note: The Real Player plugin for mac doesn't expose a version at all. |
134 static const PluginGroupDefinition kGroupDefinitions[] = { | 121 static const PluginGroupDefinition kGroupDefinitions[] = { |
135 kFlashDefinition, | 122 kFlashDefinition, |
136 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", | 123 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
137 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), | 124 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, |
138 "http://www.apple.com/quicktime/download/" }, | |
139 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 125 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
140 kJavaVersionRange, arraysize(kJavaVersionRange), | 126 kJavaVersionRange, arraysize(kJavaVersionRange) }, |
141 "http://support.apple.com/kb/HT1338" }, | |
142 kSilverlightDefinition, | 127 kSilverlightDefinition, |
143 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, | 128 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, |
144 arraysize(kFlip4MacVersionRange), | 129 arraysize(kFlip4MacVersionRange) }, |
145 "http://www.telestream.net/flip4mac-wmv/overview.htm" }, | |
146 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player", | 130 { "divx-player", "DivX Plus Web Player", "DivX Plus Web Player", |
147 kDivXVersionRange, arraysize(kDivXVersionRange), | 131 NULL, 0 }, |
148 "http://www.divx.com/en/software/divx-plus/web-player" }, | |
149 kShockwaveDefinition, | 132 kShockwaveDefinition, |
150 kChromePdfDefinition, | 133 kChromePdfDefinition, |
151 kGoogleTalkDefinition, | 134 kGoogleTalkDefinition, |
152 }; | 135 }; |
153 | 136 |
154 #elif defined(OS_WIN) | 137 #elif defined(OS_WIN) |
155 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of | 138 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of |
156 // the RealPlayer files. | 139 // the RealPlayer files. |
157 static const VersionRangeDefinition kQuicktimeVersionRange[] = { | 140 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
158 { "", "", "7.6.9", true } | 141 { "", "", "7.6.9" } |
159 }; | 142 }; |
160 static const VersionRangeDefinition kJavaVersionRange[] = { | 143 static const VersionRangeDefinition kJavaVersionRange[] = { |
161 { "0", "7", "6.0.310", true }, // "310" is not a typo. | 144 { "0", "7", "6.0.310" }, // "310" is not a typo. |
162 { "7", "", "10.3", true } // JDK7u3 identifies itself as 10.3 | 145 { "7", "", "10.3" } // JDK7u3 identifies itself as 10.3 |
163 }; | 146 }; |
164 // This is up to date with | 147 // This is up to date with |
165 // http://www.adobe.com/support/security/bulletins/apsb12-01.html | 148 // http://www.adobe.com/support/security/bulletins/apsb12-01.html |
166 static const VersionRangeDefinition kAdobeReaderVersionRange[] = { | 149 static const VersionRangeDefinition kAdobeReaderVersionRange[] = { |
167 { "10", "11", "10.1.2", false }, | 150 { "10", "11", "10.1.2" }, |
168 { "0", "10", "9.5", false } | 151 { "0", "10", "9.5" } |
169 }; | 152 }; |
170 static const VersionRangeDefinition kDivXVersionRange[] = { | 153 static const VersionRangeDefinition kDivXVersionRange[] = { |
171 { "", "", "1.4.3.4", true } | 154 { "", "", "1.4.3.4" } |
172 }; | 155 }; |
173 // This is up to date with | 156 // This is up to date with |
174 // http://service.real.com/realplayer/security/02062012_player/en/ | 157 // http://service.real.com/realplayer/security/02062012_player/en/ |
175 static const VersionRangeDefinition kRealPlayerVersionRange[] = { | 158 static const VersionRangeDefinition kRealPlayerVersionRange[] = { |
176 { "", "", "15.0.2.71", true } | 159 { "", "", "15.0.2.71" } |
177 }; | 160 }; |
178 static const PluginGroupDefinition kGroupDefinitions[] = { | 161 static const PluginGroupDefinition kGroupDefinitions[] = { |
179 kFlashDefinition, | 162 kFlashDefinition, |
180 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", | 163 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
181 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), | 164 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange) }, |
182 "http://www.apple.com/quicktime/download/" }, | |
183 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 165 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
184 kJavaVersionRange, arraysize(kJavaVersionRange), | 166 kJavaVersionRange, arraysize(kJavaVersionRange) }, |
185 "http://www.java.com/download" }, | |
186 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat", | 167 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat", |
187 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange), | 168 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange) }, |
188 "http://get.adobe.com/reader/" }, | |
189 kSilverlightDefinition, | 169 kSilverlightDefinition, |
190 kShockwaveDefinition, | 170 kShockwaveDefinition, |
191 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, | 171 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, |
192 arraysize(kDivXVersionRange), | 172 arraysize(kDivXVersionRange) }, |
193 "http://download.divx.com/divx/autoupdate/player/" | |
194 "DivXWebPlayerInstaller.exe" }, | |
195 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer", | 173 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer", |
196 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange), | 174 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange) }, |
197 "http://www.real.com/realplayer/download" }, | |
198 // These are here for grouping, no vulnerabilities known. | 175 // These are here for grouping, no vulnerabilities known. |
199 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, | 176 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, |
200 "Windows Media Player", kAllVersionsInfobarVersionRange, | 177 "Windows Media Player", NULL, 0 }, |
201 arraysize(kAllVersionsInfobarVersionRange), "" }, | |
202 { "microsoft-office", "Microsoft Office", "Microsoft Office", | 178 { "microsoft-office", "Microsoft Office", "Microsoft Office", |
203 NULL, 0, "" }, | 179 NULL, 0 }, |
204 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", kAllVersionsInfobarVersionRange, | 180 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", NULL, 0 }, |
205 arraysize(kAllVersionsInfobarVersionRange), "" }, | |
206 kChromePdfDefinition, | 181 kChromePdfDefinition, |
207 kGoogleTalkDefinition, | 182 kGoogleTalkDefinition, |
208 }; | 183 }; |
209 | 184 |
210 #elif defined(OS_CHROMEOS) | 185 #elif defined(OS_CHROMEOS) |
211 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable | 186 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable |
212 // plug-ins, so we just use these definitions for grouping. | 187 // plug-ins, so we just use these definitions for grouping. |
213 static const PluginGroupDefinition kGroupDefinitions[] = { | 188 static const PluginGroupDefinition kGroupDefinitions[] = { |
214 kFlashDefinition, | 189 kFlashDefinition, |
215 kChromePdfDefinition, | 190 kChromePdfDefinition, |
216 }; | 191 }; |
217 | 192 |
218 #else // Most importantly, covers desktop Linux. | 193 #else // Most importantly, covers desktop Linux. |
219 static const VersionRangeDefinition kJavaVersionRange[] = { | 194 static const VersionRangeDefinition kJavaVersionRange[] = { |
220 { "0", "1.7", "1.6.0.31", true }, | 195 { "0", "1.7", "1.6.0.31" }, |
221 { "1.7", "", "1.7.0.3", true } | 196 { "1.7", "", "1.7.0.3" } |
222 }; | 197 }; |
223 | 198 |
224 // Up to date with: | 199 // Up to date with: |
225 // http://blog.fuseyism.com/index.php/2012/02/15/ | 200 // http://blog.fuseyism.com/index.php/2012/02/15/ |
226 // security-icedtea6-1-8-13-1-9-13-1-10-6-and-icedtea-2-0-1-released/ | 201 // security-icedtea6-1-8-13-1-9-13-1-10-6-and-icedtea-2-0-1-released/ |
227 static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = { | 202 static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = { |
228 { "0", "1.9", "1.8.13", true }, | 203 { "0", "1.9", "1.8.13" }, |
229 { "1.9", "1.10", "1.9.13", true }, | 204 { "1.9", "1.10", "1.9.13" }, |
230 { "1.10", "2", "1.10.6", true }, | 205 { "1.10", "2", "1.10.6" }, |
231 { "2", "", "2.0.1", true } | 206 { "2", "", "2.0.1" } |
232 }; | 207 }; |
233 | 208 |
234 static const PluginGroupDefinition kGroupDefinitions[] = { | 209 static const PluginGroupDefinition kGroupDefinitions[] = { |
235 // Flash on Linux is significant because there isn't yet a built-in Flash | 210 // Flash on Linux is significant because there isn't yet a built-in Flash |
236 // plug-in on the Linux 64-bit version of Chrome. | 211 // plug-in on the Linux 64-bit version of Chrome. |
237 kFlashDefinition, | 212 kFlashDefinition, |
238 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 213 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
239 kJavaVersionRange, arraysize(kJavaVersionRange), | 214 kJavaVersionRange, arraysize(kJavaVersionRange) }, |
240 "http://www.java.com/en/download/manual.jsp" }, | |
241 { "redhat-icetea-java", "IcedTea", "IcedTea", | 215 { "redhat-icetea-java", "IcedTea", "IcedTea", |
242 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange), | 216 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange) }, |
243 "http://www.linuxsecurity.com/content/section/3/170/" }, | |
244 kChromePdfDefinition, | 217 kChromePdfDefinition, |
245 kGoogleTalkDefinition, | 218 kGoogleTalkDefinition, |
246 }; | 219 }; |
247 #endif | 220 #endif |
248 | 221 |
249 // static | 222 // static |
250 PluginList* PluginList::Singleton() { | 223 PluginList* PluginList::Singleton() { |
251 return g_singleton.Pointer(); | 224 return g_singleton.Pointer(); |
252 } | 225 } |
253 | 226 |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 } | 713 } |
741 return false; | 714 return false; |
742 } | 715 } |
743 | 716 |
744 PluginList::~PluginList() { | 717 PluginList::~PluginList() { |
745 } | 718 } |
746 | 719 |
747 | 720 |
748 } // namespace npapi | 721 } // namespace npapi |
749 } // namespace webkit | 722 } // namespace webkit |
OLD | NEW |