| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Some version ranges can be shared across operating systems. This should be | 56 // Some version ranges can be shared across operating systems. This should be |
| 57 // done where possible to avoid duplication. | 57 // 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 |
| 58 // This is up to date with | 68 // This is up to date with |
| 59 // http://www.adobe.com/support/security/bulletins/apsb11-26.html | 69 // http://www.adobe.com/support/security/bulletins/apsb11-26.html |
| 60 static const VersionRangeDefinition kFlashVersionRange[] = { | 70 static const VersionRangeDefinition kFlashVersionRange[] = { |
| 61 { "", "", "10.3.183", false } | 71 { "", "", "10.3.183", false } |
| 62 }; | 72 }; |
| 63 // This is up to date with | 73 // This is up to date with |
| 64 // http://www.adobe.com/support/security/bulletins/apsb11-19.html | 74 // http://www.adobe.com/support/security/bulletins/apsb11-19.html |
| 65 static const VersionRangeDefinition kShockwaveVersionRange[] = { | 75 static const VersionRangeDefinition kShockwaveVersionRange[] = { |
| 66 { "", "", "11.6.1.629", true } | 76 { "", "", "11.6.1.629", true } |
| 67 }; | 77 }; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 79 #define kShockwaveDefinition { \ | 89 #define kShockwaveDefinition { \ |
| 80 "shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \ | 90 "shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \ |
| 81 kShockwaveVersionRange, arraysize(kShockwaveVersionRange), \ | 91 kShockwaveVersionRange, arraysize(kShockwaveVersionRange), \ |
| 82 "http://www.adobe.com/shockwave/download/" } | 92 "http://www.adobe.com/shockwave/download/" } |
| 83 | 93 |
| 84 #define kSilverlightDefinition { \ | 94 #define kSilverlightDefinition { \ |
| 85 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ | 95 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ |
| 86 kSilverlightVersionRange, arraysize(kSilverlightVersionRange), \ | 96 kSilverlightVersionRange, arraysize(kSilverlightVersionRange), \ |
| 87 "http://www.microsoft.com/getsilverlight/" } | 97 "http://www.microsoft.com/getsilverlight/" } |
| 88 | 98 |
| 99 #define kChromePdfDefinition { \ |
| 100 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", \ |
| 101 kAllVersionsNoInfobarVersionRange, \ |
| 102 arraysize(kAllVersionsNoInfobarVersionRange), "" } |
| 103 |
| 104 #define kGoogleTalkDefinition { \ |
| 105 "google-talk", "Google Talk NPAPI Plugin", "Google Talk NPAPI Plugin", \ |
| 106 kAllVersionsNoInfobarVersionRange, \ |
| 107 arraysize(kAllVersionsNoInfobarVersionRange), ""} |
| 108 |
| 89 #if defined(OS_MACOSX) | 109 #if defined(OS_MACOSX) |
| 90 // Plugin Groups for Mac. | 110 // Plugin Groups for Mac. |
| 91 // Plugins are listed here as soon as vulnerabilities and solutions | 111 // Plugins are listed here as soon as vulnerabilities and solutions |
| 92 // (new versions) are published. | 112 // (new versions) are published. |
| 93 static const VersionRangeDefinition kQuicktimeVersionRange[] = { | 113 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
| 94 { "", "", "7.6.6", true } | 114 { "", "", "7.6.6", true } |
| 95 }; | 115 }; |
| 96 static const VersionRangeDefinition kJavaVersionRange[] = { | 116 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 97 { "0", "13.0", "12.8.0", true }, // Leopard | 117 { "0", "13.0", "12.8.0", true }, // Leopard |
| 98 { "13.0", "14.0", "13.5.0", true }, // Snow Leopard | 118 { "13.0", "14.0", "13.5.0", true }, // Snow Leopard |
| 99 { "14.0", "", "14.0.3", true } // Lion | 119 { "14.0", "", "14.0.3", true } // Lion |
| 100 }; | 120 }; |
| 101 static const VersionRangeDefinition kFlip4MacVersionRange[] = { | 121 static const VersionRangeDefinition kFlip4MacVersionRange[] = { |
| 102 { "", "", "2.2.1", true } | 122 { "", "", "2.2.1", true } |
| 103 }; | 123 }; |
| 104 // Note: The Adobe Reader browser plug-in is not supported in Chrome. | 124 // Note: The Adobe Reader browser plug-in is not supported in Chrome. |
| 105 // Note: The Real Player plugin for mac doesn't expose a version at all. | 125 // Note: The Real Player plugin for mac doesn't expose a version at all. |
| 106 static const PluginGroupDefinition kGroupDefinitions[] = { | 126 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 107 kFlashDefinition, | 127 kFlashDefinition, |
| 108 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", | 128 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
| 109 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), | 129 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), |
| 110 "http://www.apple.com/quicktime/download/" }, | 130 "http://www.apple.com/quicktime/download/" }, |
| 111 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 131 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 112 kJavaVersionRange, arraysize(kJavaVersionRange), | 132 kJavaVersionRange, arraysize(kJavaVersionRange), |
| 113 "http://support.apple.com/kb/HT1338" }, | 133 "http://support.apple.com/kb/HT1338" }, |
| 114 kSilverlightDefinition, | 134 kSilverlightDefinition, |
| 115 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, | 135 { "flip4mac", "Flip4Mac", "Flip4Mac", kFlip4MacVersionRange, |
| 116 arraysize(kFlip4MacVersionRange), | 136 arraysize(kFlip4MacVersionRange), |
| 117 "http://www.telestream.net/flip4mac-wmv/overview.htm" }, | 137 "http://www.telestream.net/flip4mac-wmv/overview.htm" }, |
| 118 kShockwaveDefinition | 138 kShockwaveDefinition, |
| 139 kChromePdfDefinition, |
| 140 kGoogleTalkDefinition, |
| 119 }; | 141 }; |
| 120 | 142 |
| 121 #elif defined(OS_WIN) | 143 #elif defined(OS_WIN) |
| 122 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of | 144 // TODO(panayiotis): We should group "RealJukebox NS Plugin" with the rest of |
| 123 // the RealPlayer files. | 145 // the RealPlayer files. |
| 124 static const VersionRangeDefinition kQuicktimeVersionRange[] = { | 146 static const VersionRangeDefinition kQuicktimeVersionRange[] = { |
| 125 { "", "", "7.6.9", true } | 147 { "", "", "7.6.9", true } |
| 126 }; | 148 }; |
| 127 static const VersionRangeDefinition kJavaVersionRange[] = { | 149 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 128 { "0", "7", "6.0.310", true }, // "310" is not a typo. | 150 { "0", "7", "6.0.310", true }, // "310" is not a typo. |
| 129 { "7", "", "10.3", true } // JDK7u3 identifies itself as 10.3 | 151 { "7", "", "10.3", true } // JDK7u3 identifies itself as 10.3 |
| 130 }; | 152 }; |
| 131 // This is up to date with | 153 // This is up to date with |
| 132 // http://www.adobe.com/support/security/bulletins/apsb11-24.html | 154 // http://www.adobe.com/support/security/bulletins/apsb11-24.html |
| 133 static const VersionRangeDefinition kAdobeReaderVersionRange[] = { | 155 static const VersionRangeDefinition kAdobeReaderVersionRange[] = { |
| 134 { "10", "11", "10.1.1", false }, | 156 { "10", "11", "10.1.1", false }, |
| 135 { "9", "10", "9.4.6", false }, | 157 { "9", "10", "9.4.6", false }, |
| 136 { "0", "9", "8.3.1", false } | 158 { "0", "9", "8.3.1", false } |
| 137 }; | 159 }; |
| 138 static const VersionRangeDefinition kDivXVersionRange[] = { | 160 static const VersionRangeDefinition kDivXVersionRange[] = { |
| 139 { "", "", "1.4.3.4", false } | 161 { "", "", "1.4.3.4", false } |
| 140 }; | 162 }; |
| 141 static const VersionRangeDefinition kRealPlayerVersionRange[] = { | 163 static const VersionRangeDefinition kRealPlayerVersionRange[] = { |
| 142 { "", "", "12.0.1.666", true } | 164 { "", "", "12.0.1.666", true } |
| 143 }; | 165 }; |
| 144 static const VersionRangeDefinition kWindowsMediaPlayerVersionRange[] = { | |
| 145 { "", "", "", true } | |
| 146 }; | |
| 147 static const VersionRangeDefinition kNvidia3DVersionRange[] = { | |
| 148 { "", "", "", true } | |
| 149 }; | |
| 150 static const PluginGroupDefinition kGroupDefinitions[] = { | 166 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 151 kFlashDefinition, | 167 kFlashDefinition, |
| 152 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", | 168 { "apple-quicktime", PluginGroup::kQuickTimeGroupName, "QuickTime Plug-in", |
| 153 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), | 169 kQuicktimeVersionRange, arraysize(kQuicktimeVersionRange), |
| 154 "http://www.apple.com/quicktime/download/" }, | 170 "http://www.apple.com/quicktime/download/" }, |
| 155 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 171 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 156 kJavaVersionRange, arraysize(kJavaVersionRange), | 172 kJavaVersionRange, arraysize(kJavaVersionRange), |
| 157 "http://www.java.com/download" }, | 173 "http://www.java.com/download" }, |
| 158 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat", | 174 { "adobe-reader", PluginGroup::kAdobeReaderGroupName, "Adobe Acrobat", |
| 159 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange), | 175 kAdobeReaderVersionRange, arraysize(kAdobeReaderVersionRange), |
| 160 "http://get.adobe.com/reader/" }, | 176 "http://get.adobe.com/reader/" }, |
| 161 kSilverlightDefinition, | 177 kSilverlightDefinition, |
| 162 kShockwaveDefinition, | 178 kShockwaveDefinition, |
| 163 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, | 179 { "divx-player", "DivX Player", "DivX Web Player", kDivXVersionRange, |
| 164 arraysize(kDivXVersionRange), | 180 arraysize(kDivXVersionRange), |
| 165 "http://download.divx.com/divx/autoupdate/player/" | 181 "http://download.divx.com/divx/autoupdate/player/" |
| 166 "DivXWebPlayerInstaller.exe" }, | 182 "DivXWebPlayerInstaller.exe" }, |
| 167 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer", | 183 { "realplayer", PluginGroup::kRealPlayerGroupName, "RealPlayer", |
| 168 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange), | 184 kRealPlayerVersionRange, arraysize(kRealPlayerVersionRange), |
| 169 "http://www.real.com/realplayer/download" }, | 185 "http://www.real.com/realplayer/download" }, |
| 170 // These are here for grouping, no vulnerabilities known. | 186 // These are here for grouping, no vulnerabilities known. |
| 171 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, | 187 { "windows-media-player", PluginGroup::kWindowsMediaPlayerGroupName, |
| 172 "Windows Media Player", kWindowsMediaPlayerVersionRange, | 188 "Windows Media Player", kAllVersionsInfobarVersionRange, |
| 173 arraysize(kWindowsMediaPlayerVersionRange), "" }, | 189 arraysize(kAllVersionsInfobarVersionRange), "" }, |
| 174 { "microsoft-office", "Microsoft Office", "Microsoft Office", | 190 { "microsoft-office", "Microsoft Office", "Microsoft Office", |
| 175 NULL, 0, "" }, | 191 NULL, 0, "" }, |
| 176 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", kNvidia3DVersionRange, | 192 { "nvidia-3d", "NVIDIA 3D", "NVIDIA 3D", kAllVersionsInfobarVersionRange, |
| 177 arraysize(kNvidia3DVersionRange), "" }, | 193 arraysize(kAllVersionsInfobarVersionRange), "" }, |
| 194 kChromePdfDefinition, |
| 195 kGoogleTalkDefinition, |
| 178 }; | 196 }; |
| 179 | 197 |
| 180 #elif defined(OS_CHROMEOS) | 198 #elif defined(OS_CHROMEOS) |
| 181 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable | 199 // ChromeOS generally has (autoupdated) system plug-ins and no user-installable |
| 182 // plug-ins. | 200 // plug-ins, so we just use these definitions for grouping. |
| 183 static const PluginGroupDefinition kGroupDefinitions[] = { }; | 201 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 202 kFlashDefinition, |
| 203 kChromePdfDefinition, |
| 204 }; |
| 184 | 205 |
| 185 #else // Most importantly, covers desktop Linux. | 206 #else // Most importantly, covers desktop Linux. |
| 186 static const VersionRangeDefinition kJavaVersionRange[] = { | 207 static const VersionRangeDefinition kJavaVersionRange[] = { |
| 187 { "0", "1.7", "1.6.0.29", true }, | 208 { "0", "1.7", "1.6.0.29", true }, |
| 188 { "1.7", "", "1.7.0.1", true } | 209 { "1.7", "", "1.7.0.1", true } |
| 189 }; | 210 }; |
| 190 | 211 |
| 191 static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = { | 212 static const VersionRangeDefinition kRedhatIcedTeaVersionRange[] = { |
| 192 { "0", "1.9", "1.8.10", true }, | 213 { "0", "1.9", "1.8.10", true }, |
| 193 { "1.9", "1.10", "1.9.10", true }, | 214 { "1.9", "1.10", "1.9.10", true }, |
| 194 { "1.10", "", "1.10.4", true } | 215 { "1.10", "", "1.10.4", true } |
| 195 }; | 216 }; |
| 196 | 217 |
| 197 static const PluginGroupDefinition kGroupDefinitions[] = { | 218 static const PluginGroupDefinition kGroupDefinitions[] = { |
| 198 // Flash on Linux is significant because there isn't yet a built-in Flash | 219 // Flash on Linux is significant because there isn't yet a built-in Flash |
| 199 // plug-in on the Linux 64-bit version of Chrome. | 220 // plug-in on the Linux 64-bit version of Chrome. |
| 200 kFlashDefinition, | 221 kFlashDefinition, |
| 201 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", | 222 { "java-runtime-environment", PluginGroup::kJavaGroupName, "Java", |
| 202 kJavaVersionRange, arraysize(kJavaVersionRange), | 223 kJavaVersionRange, arraysize(kJavaVersionRange), |
| 203 "http://www.java.com/en/download/manual.jsp" }, | 224 "http://www.java.com/en/download/manual.jsp" }, |
| 204 { "redhat-icetea-java", "IcedTea", "IcedTea", | 225 { "redhat-icetea-java", "IcedTea", "IcedTea", |
| 205 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange), | 226 kRedhatIcedTeaVersionRange, arraysize(kRedhatIcedTeaVersionRange), |
| 206 "http://www.linuxsecurity.com/content/section/3/170/" }, | 227 "http://www.linuxsecurity.com/content/section/3/170/" }, |
| 228 kChromePdfDefinition, |
| 229 kGoogleTalkDefinition, |
| 207 }; | 230 }; |
| 208 #endif | 231 #endif |
| 209 | 232 |
| 210 // static | 233 // static |
| 211 PluginList* PluginList::Singleton() { | 234 PluginList* PluginList::Singleton() { |
| 212 return g_singleton.Pointer(); | 235 return g_singleton.Pointer(); |
| 213 } | 236 } |
| 214 | 237 |
| 215 // static | 238 // static |
| 216 bool PluginList::DebugPluginLoading() { | 239 bool PluginList::DebugPluginLoading() { |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 } | 724 } |
| 702 return false; | 725 return false; |
| 703 } | 726 } |
| 704 | 727 |
| 705 PluginList::~PluginList() { | 728 PluginList::~PluginList() { |
| 706 } | 729 } |
| 707 | 730 |
| 708 | 731 |
| 709 } // namespace npapi | 732 } // namespace npapi |
| 710 } // namespace webkit | 733 } // namespace webkit |
| OLD | NEW |