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/files/file_enumerator.h" | |
11 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
12 #include "base/string_util.h" | 11 #include "base/string_util.h" |
13 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
15 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
16 #include "webkit/plugins/npapi/plugin_lib.h" | 15 #include "webkit/plugins/npapi/plugin_lib.h" |
17 | 16 |
18 namespace webkit { | 17 namespace webkit { |
19 namespace npapi { | 18 namespace npapi { |
20 | 19 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs)
{ | 71 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs)
{ |
73 // Load from the user's area | 72 // Load from the user's area |
74 GetPluginCommonDirectory(plugin_dirs, true); | 73 GetPluginCommonDirectory(plugin_dirs, true); |
75 | 74 |
76 // Load from the machine-wide area | 75 // Load from the machine-wide area |
77 GetPluginCommonDirectory(plugin_dirs, false); | 76 GetPluginCommonDirectory(plugin_dirs, false); |
78 } | 77 } |
79 | 78 |
80 void PluginList::GetPluginsInDir( | 79 void PluginList::GetPluginsInDir( |
81 const base::FilePath& path, std::vector<base::FilePath>* plugins) { | 80 const base::FilePath& path, std::vector<base::FilePath>* plugins) { |
82 base::FileEnumerator enumerator(path, | 81 file_util::FileEnumerator enumerator(path, |
83 false, // not recursive | 82 false, // not recursive |
84 base::FileEnumerator::DIRECTORIES); | 83 file_util::FileEnumerator::DIRECTORIES); |
85 for (base::FilePath path = enumerator.Next(); !path.value().empty(); | 84 for (base::FilePath path = enumerator.Next(); !path.value().empty(); |
86 path = enumerator.Next()) { | 85 path = enumerator.Next()) { |
87 plugins->push_back(path); | 86 plugins->push_back(path); |
88 } | 87 } |
89 } | 88 } |
90 | 89 |
91 bool PluginList::ShouldLoadPluginUsingPluginList( | 90 bool PluginList::ShouldLoadPluginUsingPluginList( |
92 const WebPluginInfo& info, | 91 const WebPluginInfo& info, |
93 std::vector<webkit::WebPluginInfo>* plugins) { | 92 std::vector<webkit::WebPluginInfo>* plugins) { |
94 return !IsBlacklistedPlugin(info); | 93 return !IsBlacklistedPlugin(info); |
95 } | 94 } |
96 | 95 |
97 } // namespace npapi | 96 } // namespace npapi |
98 } // namespace webkit | 97 } // namespace webkit |
OLD | NEW |