Chromium Code Reviews| 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" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 | 268 |
| 269 if (ReadPlistPluginInfo(filename, bundle.get(), info)) | 269 if (ReadPlistPluginInfo(filename, bundle.get(), info)) |
| 270 return true; | 270 return true; |
| 271 | 271 |
| 272 // ... or not | 272 // ... or not |
| 273 | 273 |
| 274 return false; | 274 return false; |
| 275 } | 275 } |
| 276 | 276 |
| 277 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs) { | 277 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs) { |
| 278 if (PluginList::plugins_discovery_disabled_) { | |
|
Bernhard Bauer
2013/06/06 08:28:50
Remove braces please.
Also, can you make the prev
seva
2013/06/06 22:11:25
Done.
| |
| 279 return; | |
| 280 } | |
| 281 | |
| 278 // Load from the user's area | 282 // Load from the user's area |
| 279 GetPluginCommonDirectory(plugin_dirs, true); | 283 GetPluginCommonDirectory(plugin_dirs, true); |
| 280 | 284 |
| 281 // Load from the machine-wide area | 285 // Load from the machine-wide area |
| 282 GetPluginCommonDirectory(plugin_dirs, false); | 286 GetPluginCommonDirectory(plugin_dirs, false); |
| 283 } | 287 } |
| 284 | 288 |
| 285 void PluginList::GetPluginsInDir( | 289 void PluginList::GetPluginsInDir( |
| 286 const base::FilePath& path, std::vector<base::FilePath>* plugins) { | 290 const base::FilePath& path, std::vector<base::FilePath>* plugins) { |
| 287 file_util::FileEnumerator enumerator(path, | 291 file_util::FileEnumerator enumerator(path, |
| 288 false, // not recursive | 292 false, // not recursive |
| 289 file_util::FileEnumerator::DIRECTORIES); | 293 file_util::FileEnumerator::DIRECTORIES); |
| 290 for (base::FilePath path = enumerator.Next(); !path.value().empty(); | 294 for (base::FilePath path = enumerator.Next(); !path.value().empty(); |
| 291 path = enumerator.Next()) { | 295 path = enumerator.Next()) { |
| 292 plugins->push_back(path); | 296 plugins->push_back(path); |
| 293 } | 297 } |
| 294 } | 298 } |
| 295 | 299 |
| 296 bool PluginList::ShouldLoadPluginUsingPluginList( | 300 bool PluginList::ShouldLoadPluginUsingPluginList( |
| 297 const WebPluginInfo& info, | 301 const WebPluginInfo& info, |
| 298 std::vector<webkit::WebPluginInfo>* plugins) { | 302 std::vector<webkit::WebPluginInfo>* plugins) { |
| 299 return !IsBlacklistedPlugin(info); | 303 return !IsBlacklistedPlugin(info); |
| 300 } | 304 } |
| 301 | 305 |
| 302 } // namespace npapi | 306 } // namespace npapi |
| 303 } // namespace webkit | 307 } // namespace webkit |
| OLD | NEW |