| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/glue/plugins/plugin_list.h" | 5 #include "webkit/glue/plugins/plugin_list.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 false, // not recursive | 62 false, // not recursive |
| 63 file_util::FileEnumerator::DIRECTORIES); | 63 file_util::FileEnumerator::DIRECTORIES); |
| 64 for (FilePath path = enumerator.Next(); !path.value().empty(); | 64 for (FilePath path = enumerator.Next(); !path.value().empty(); |
| 65 path = enumerator.Next()) { | 65 path = enumerator.Next()) { |
| 66 LoadPlugin(path, plugins); | 66 LoadPlugin(path, plugins); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, | 70 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
| 71 std::vector<WebPluginInfo>* plugins) { | 71 std::vector<WebPluginInfo>* plugins) { |
| 72 // The Gears plugin is Safari-specific, and causes crashes, so don't load it. | 72 // Screen out some plugins that we know don't work at all. |
| 73 for (std::vector<WebPluginMimeType>::const_iterator i = | 73 for (std::vector<WebPluginMimeType>::const_iterator i = |
| 74 info.mime_types.begin(); i != info.mime_types.end(); ++i) { | 74 info.mime_types.begin(); i != info.mime_types.end(); ++i) { |
| 75 if (i->mime_type == "application/x-googlegears") | 75 // The Gears plugin is Safari-specific. MoveNetworks Quantum Media Player |
| 76 // and Shockwave for Director crash during initiazilation, and don't work in |
| 77 // Safari on 10.6 either. |
| 78 if (i->mime_type == "application/x-googlegears" || |
| 79 i->mime_type == "application/x-vnd.movenetworks.qm" || |
| 80 i->mime_type == "application/x-director") { |
| 76 return false; | 81 return false; |
| 82 } |
| 77 } | 83 } |
| 78 | 84 |
| 79 // Hierarchy check | 85 // Hierarchy check |
| 80 // (we're loading plugins hierarchically from Library folders, so plugins we | 86 // (we're loading plugins hierarchically from Library folders, so plugins we |
| 81 // encounter earlier must override plugins we encounter later) | 87 // encounter earlier must override plugins we encounter later) |
| 82 for (size_t i = 0; i < plugins->size(); ++i) { | 88 for (size_t i = 0; i < plugins->size(); ++i) { |
| 83 if ((*plugins)[i].path.BaseName() == info.path.BaseName()) { | 89 if ((*plugins)[i].path.BaseName() == info.path.BaseName()) { |
| 84 return false; // We already have a loaded plugin higher in the hierarchy. | 90 return false; // We already have a loaded plugin higher in the hierarchy. |
| 85 } | 91 } |
| 86 } | 92 } |
| 87 | 93 |
| 88 return true; | 94 return true; |
| 89 } | 95 } |
| 90 | 96 |
| 91 } // namespace NPAPI | 97 } // namespace NPAPI |
| OLD | NEW |