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 #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/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 void PluginList::PlatformInit() { | 68 void PluginList::PlatformInit() { |
69 } | 69 } |
70 | 70 |
71 void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { | 71 void PluginList::GetPluginDirectories(std::vector<FilePath>* plugin_dirs) { |
72 // Load from the user's area | 72 // Load from the user's area |
73 GetPluginCommonDirectory(plugin_dirs, true); | 73 GetPluginCommonDirectory(plugin_dirs, true); |
74 | 74 |
75 // Load from the machine-wide area | 75 // Load from the machine-wide area |
76 GetPluginCommonDirectory(plugin_dirs, false); | 76 GetPluginCommonDirectory(plugin_dirs, false); |
77 | |
78 // 10.5 includes the Java2 plugin, but as of Java for Mac OS X 10.5 Update 10 | |
79 // no longer has a symlink to it in the Internet Plug-Ins directory. | |
80 // Manually include it since there's no other way to support Java. | |
81 if (base::mac::IsOSLeopard()) { | |
82 plugin_dirs->push_back(FilePath( | |
83 "/System/Library/Java/Support/Deploy.bundle/Contents/Resources")); | |
84 } | |
85 } | 77 } |
86 | 78 |
87 void PluginList::GetPluginsInDir( | 79 void PluginList::GetPluginsInDir( |
88 const FilePath& path, std::vector<FilePath>* plugins) { | 80 const FilePath& path, std::vector<FilePath>* plugins) { |
89 file_util::FileEnumerator enumerator(path, | 81 file_util::FileEnumerator enumerator(path, |
90 false, // not recursive | 82 false, // not recursive |
91 file_util::FileEnumerator::DIRECTORIES); | 83 file_util::FileEnumerator::DIRECTORIES); |
92 for (FilePath path = enumerator.Next(); !path.value().empty(); | 84 for (FilePath path = enumerator.Next(); !path.value().empty(); |
93 path = enumerator.Next()) { | 85 path = enumerator.Next()) { |
94 plugins->push_back(path); | 86 plugins->push_back(path); |
95 } | 87 } |
96 } | 88 } |
97 | 89 |
98 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, | 90 bool PluginList::ShouldLoadPlugin(const WebPluginInfo& info, |
99 ScopedVector<PluginGroup>* plugin_groups) { | 91 ScopedVector<PluginGroup>* plugin_groups) { |
100 return !IsBlacklistedPlugin(info); | 92 return !IsBlacklistedPlugin(info); |
101 } | 93 } |
102 | 94 |
103 } // namespace npapi | 95 } // namespace npapi |
104 } // namespace webkit | 96 } // namespace webkit |
OLD | NEW |