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