| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "webkit/glue/plugins/plugin_list.h" | 7 #include "webkit/glue/plugins/plugin_list.h" |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 file_util::FileEnumerator enumerator(path, | 61 file_util::FileEnumerator enumerator(path, |
| 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); | 66 LoadPlugin(path); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) { | 70 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info) { |
| 71 | 71 // TODO(port): uncomment the next line to enable plugins--disabled by |
| 72 // default so that public dev builds fall back correctly to the no-plugin |
| 73 // code on pages with plugins. |
| 74 return false; |
| 75 |
| 72 // Hierarchy check | 76 // Hierarchy check |
| 73 // (we're loading plugins hierarchically from Library folders, so plugins we | 77 // (we're loading plugins hierarchically from Library folders, so plugins we |
| 74 // encounter earlier must override plugins we encounter later) | 78 // encounter earlier must override plugins we encounter later) |
| 75 | 79 |
| 76 for (size_t i = 0; i < plugins_.size(); ++i) { | 80 for (size_t i = 0; i < plugins_.size(); ++i) { |
| 77 if (plugins_[i].path.BaseName() == info.path.BaseName()) { | 81 if (plugins_[i].path.BaseName() == info.path.BaseName()) { |
| 78 return false; // We already have a loaded plugin higher in the hierarchy. | 82 return false; // We already have a loaded plugin higher in the hierarchy. |
| 79 } | 83 } |
| 80 } | 84 } |
| 81 | 85 |
| 82 return true; | 86 return true; |
| 83 } | 87 } |
| 84 | 88 |
| 85 void PluginList::LoadInternalPlugins() { | 89 void PluginList::LoadInternalPlugins() { |
| 86 // none for now | 90 // none for now |
| 87 } | 91 } |
| 88 | 92 |
| 89 } // namespace NPAPI | 93 } // namespace NPAPI |
| OLD | NEW |