| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // http://support.microsoft.com/kb/2668562 | 76 // http://support.microsoft.com/kb/2668562 |
| 77 // http://technet.microsoft.com/en-us/security/Bulletin/MS12-016 | 77 // http://technet.microsoft.com/en-us/security/Bulletin/MS12-016 |
| 78 static const VersionRangeDefinition kSilverlightVersionRange[] = { | 78 static const VersionRangeDefinition kSilverlightVersionRange[] = { |
| 79 { "0", "5", "4.1.10111.0" }, | 79 { "0", "5", "4.1.10111.0" }, |
| 80 { "5", "6", "" }, | 80 { "5", "6", "" }, |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 // 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 |
| 84 // very consistent across OS'es. | 84 // very consistent across OS'es. |
| 85 #define kFlashDefinition { \ | 85 #define kFlashDefinition { \ |
| 86 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange,\ | 86 "adobe-flash-player", "Flash", "Shockwave Flash", kFlashVersionRange, \ |
| 87 arraysize(kFlashVersionRange) } | 87 arraysize(kFlashVersionRange) } |
| 88 | 88 |
| 89 #define kShockwaveDefinition { \ | 89 #define kShockwaveDefinition { \ |
| 90 "shockwave", PluginGroup::kShockwaveGroupName, "Shockwave for Director", \ | 90 "adobe-shockwave", PluginGroup::kShockwaveGroupName, \ |
| 91 kShockwaveVersionRange, arraysize(kShockwaveVersionRange) } | 91 "Shockwave for Director", kShockwaveVersionRange, \ |
| 92 arraysize(kShockwaveVersionRange) } |
| 92 | 93 |
| 93 #define kSilverlightDefinition { \ | 94 #define kSilverlightDefinition { \ |
| 94 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ | 95 "silverlight", PluginGroup::kSilverlightGroupName, "Silverlight", \ |
| 95 kSilverlightVersionRange, arraysize(kSilverlightVersionRange) } | 96 kSilverlightVersionRange, arraysize(kSilverlightVersionRange) } |
| 96 | 97 |
| 97 #define kChromePdfDefinition { \ | 98 #define kChromePdfDefinition { \ |
| 98 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 } | 99 "google-chrome-pdf", "Chrome PDF Viewer", "Chrome PDF Viewer", NULL, 0 } |
| 99 | 100 |
| 100 #define kGoogleTalkDefinition { \ | 101 #define kGoogleTalkDefinition { \ |
| 101 "google-talk", "Google Talk", "Google Talk", NULL, 0 } | 102 "google-talk", "Google Talk", "Google Talk", NULL, 0 } |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 GetPluginsInDir(extra_plugin_dirs[i], plugin_paths); | 490 GetPluginsInDir(extra_plugin_dirs[i], plugin_paths); |
| 490 | 491 |
| 491 for (size_t i = 0; i < directories_to_scan.size(); ++i) | 492 for (size_t i = 0; i < directories_to_scan.size(); ++i) |
| 492 GetPluginsInDir(directories_to_scan[i], plugin_paths); | 493 GetPluginsInDir(directories_to_scan[i], plugin_paths); |
| 493 | 494 |
| 494 #if defined(OS_WIN) | 495 #if defined(OS_WIN) |
| 495 GetPluginPathsFromRegistry(plugin_paths); | 496 GetPluginPathsFromRegistry(plugin_paths); |
| 496 #endif | 497 #endif |
| 497 } | 498 } |
| 498 | 499 |
| 500 const std::vector<PluginGroup*>& PluginList::GetHardcodedPluginGroups() const { |
| 501 return hardcoded_plugin_groups_.get(); |
| 502 } |
| 503 |
| 499 void PluginList::SetPlugins(const std::vector<webkit::WebPluginInfo>& plugins) { | 504 void PluginList::SetPlugins(const std::vector<webkit::WebPluginInfo>& plugins) { |
| 500 base::AutoLock lock(lock_); | 505 base::AutoLock lock(lock_); |
| 501 | 506 |
| 502 plugins_need_refresh_ = false; | 507 plugins_need_refresh_ = false; |
| 503 | 508 |
| 504 plugin_groups_.reset(); | 509 plugin_groups_.reset(); |
| 505 for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin(); | 510 for (std::vector<webkit::WebPluginInfo>::const_iterator it = plugins.begin(); |
| 506 it != plugins.end(); | 511 it != plugins.end(); |
| 507 ++it) { | 512 ++it) { |
| 508 AddToPluginGroups(*it, &plugin_groups_); | 513 AddToPluginGroups(*it, &plugin_groups_); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 } | 717 } |
| 713 return false; | 718 return false; |
| 714 } | 719 } |
| 715 | 720 |
| 716 PluginList::~PluginList() { | 721 PluginList::~PluginList() { |
| 717 } | 722 } |
| 718 | 723 |
| 719 | 724 |
| 720 } // namespace npapi | 725 } // namespace npapi |
| 721 } // namespace webkit | 726 } // namespace webkit |
| OLD | NEW |