Chromium Code Reviews| 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 // 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 | |
| 76 // Hierarchy check | 71 // Hierarchy check |
| 77 // (we're loading plugins hierarchically from Library folders, so plugins we | 72 // (we're loading plugins hierarchically from Library folders, so plugins we |
| 78 // encounter earlier must override plugins we encounter later) | 73 // encounter earlier must override plugins we encounter later) |
| 79 | 74 |
| 75 // first, test to make sure the user really wants plugins | |
|
Evan Martin
2009/07/13 21:39:07
this comment doesn't make sense
| |
| 76 | |
| 80 for (size_t i = 0; i < plugins_.size(); ++i) { | 77 for (size_t i = 0; i < plugins_.size(); ++i) { |
| 81 if (plugins_[i].path.BaseName() == info.path.BaseName()) { | 78 if (plugins_[i].path.BaseName() == info.path.BaseName()) { |
| 82 return false; // We already have a loaded plugin higher in the hierarchy. | 79 return false; // We already have a loaded plugin higher in the hierarchy. |
| 83 } | 80 } |
| 84 } | 81 } |
| 85 | 82 |
| 86 return true; | 83 return true; |
| 87 } | 84 } |
| 88 | 85 |
| 89 void PluginList::LoadInternalPlugins() { | 86 void PluginList::LoadInternalPlugins() { |
| 90 // none for now | 87 // none for now |
| 91 } | 88 } |
| 92 | 89 |
| 93 } // namespace NPAPI | 90 } // namespace NPAPI |
| OLD | NEW |