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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // The Gears plugin is Safari-specific, and causes crashes, so don't load it. | 72 // The Gears plugin is Safari-specific, and causes crashes, so don't load it. |
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 if (i->mime_type == "application/x-googlegears") |
76 return false; | 76 return false; |
77 } | 77 } |
78 | 78 |
79 // For now, only load plugins that we know are working reasonably well. | 79 // For now, only load plugins that we know are working reasonably well. |
80 // Anything using QuickDraw-based drawing, for example, would crash | 80 // Anything using QuickDraw-based drawing, for example, would crash |
81 // immediately. | 81 // immediately. |
| 82 |
82 std::string plugin_name = WideToUTF8(info.name); | 83 std::string plugin_name = WideToUTF8(info.name); |
83 if (!(plugin_name == "WebKit Test PlugIn" || | 84 if (!(plugin_name == "WebKit Test PlugIn" || |
84 plugin_name == "Shockwave Flash" || | 85 plugin_name == "Shockwave Flash" || |
85 plugin_name == "Picasa" || | 86 plugin_name == "Picasa" || |
86 plugin_name == "Google Talk Browser Plugin")) { | 87 plugin_name == "Google Talk Browser Plugin" || |
| 88 plugin_name == "Google Talk NPAPI Plugin")) { |
87 return false; | 89 return false; |
88 } | 90 } |
89 | 91 |
90 // Hierarchy check | 92 // Hierarchy check |
91 // (we're loading plugins hierarchically from Library folders, so plugins we | 93 // (we're loading plugins hierarchically from Library folders, so plugins we |
92 // encounter earlier must override plugins we encounter later) | 94 // encounter earlier must override plugins we encounter later) |
93 for (size_t i = 0; i < plugins->size(); ++i) { | 95 for (size_t i = 0; i < plugins->size(); ++i) { |
94 if ((*plugins)[i].path.BaseName() == info.path.BaseName()) { | 96 if ((*plugins)[i].path.BaseName() == info.path.BaseName()) { |
95 return false; // We already have a loaded plugin higher in the hierarchy. | 97 return false; // We already have a loaded plugin higher in the hierarchy. |
96 } | 98 } |
97 } | 99 } |
98 | 100 |
99 return true; | 101 return true; |
100 } | 102 } |
101 | 103 |
102 } // namespace NPAPI | 104 } // namespace NPAPI |
OLD | NEW |