| 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 <Carbon/Carbon.h> | 7 #import <Carbon/Carbon.h> |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/files/file_enumerator.h" |
| 11 #include "base/mac/mac_util.h" | 12 #include "base/mac/mac_util.h" |
| 12 #include "base/mac/scoped_cftyperef.h" | 13 #include "base/mac/scoped_cftyperef.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/native_library.h" | 15 #include "base/native_library.h" |
| 15 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 16 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 17 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
| 18 #include "base/strings/sys_string_conversions.h" | 19 #include "base/strings/sys_string_conversions.h" |
| 19 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 20 | 21 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs)
{ | 278 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs)
{ |
| 278 // Load from the user's area | 279 // Load from the user's area |
| 279 GetPluginCommonDirectory(plugin_dirs, true); | 280 GetPluginCommonDirectory(plugin_dirs, true); |
| 280 | 281 |
| 281 // Load from the machine-wide area | 282 // Load from the machine-wide area |
| 282 GetPluginCommonDirectory(plugin_dirs, false); | 283 GetPluginCommonDirectory(plugin_dirs, false); |
| 283 } | 284 } |
| 284 | 285 |
| 285 void PluginList::GetPluginsInDir( | 286 void PluginList::GetPluginsInDir( |
| 286 const base::FilePath& path, std::vector<base::FilePath>* plugins) { | 287 const base::FilePath& path, std::vector<base::FilePath>* plugins) { |
| 287 file_util::FileEnumerator enumerator(path, | 288 base::FileEnumerator enumerator(path, |
| 288 false, // not recursive | 289 false, // not recursive |
| 289 file_util::FileEnumerator::DIRECTORIES); | 290 base::FileEnumerator::DIRECTORIES); |
| 290 for (base::FilePath path = enumerator.Next(); !path.value().empty(); | 291 for (base::FilePath path = enumerator.Next(); !path.value().empty(); |
| 291 path = enumerator.Next()) { | 292 path = enumerator.Next()) { |
| 292 plugins->push_back(path); | 293 plugins->push_back(path); |
| 293 } | 294 } |
| 294 } | 295 } |
| 295 | 296 |
| 296 bool PluginList::ShouldLoadPluginUsingPluginList( | 297 bool PluginList::ShouldLoadPluginUsingPluginList( |
| 297 const WebPluginInfo& info, | 298 const WebPluginInfo& info, |
| 298 std::vector<webkit::WebPluginInfo>* plugins) { | 299 std::vector<webkit::WebPluginInfo>* plugins) { |
| 299 return !IsBlacklistedPlugin(info); | 300 return !IsBlacklistedPlugin(info); |
| 300 } | 301 } |
| 301 | 302 |
| 302 } // namespace npapi | 303 } // namespace npapi |
| 303 } // namespace webkit | 304 } // namespace webkit |
| OLD | NEW |