Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: webkit/plugins/npapi/plugin_list_mac.mm

Issue 16369004: Adding --disable-plugins-discovery command line switch to not load third-party plugins from common … (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/plugins/npapi/plugin_list.cc ('k') | webkit/plugins/npapi/plugin_list_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
268 // get the info 268 // get the info
269 269
270 if (ReadPlistPluginInfo(filename, bundle.get(), info)) 270 if (ReadPlistPluginInfo(filename, bundle.get(), info))
271 return true; 271 return true;
272 272
273 // ... or not 273 // ... or not
274 274
275 return false; 275 return false;
276 } 276 }
277 277
278 void PluginList::GetPluginDirectories(std::vector<base::FilePath>* plugin_dirs) { 278 void PluginList::GetPluginDirectories(
279 std::vector<base::FilePath>* plugin_dirs) {
280 if (PluginList::plugins_discovery_disabled_)
281 return;
282
279 // Load from the user's area 283 // Load from the user's area
280 GetPluginCommonDirectory(plugin_dirs, true); 284 GetPluginCommonDirectory(plugin_dirs, true);
281 285
282 // Load from the machine-wide area 286 // Load from the machine-wide area
283 GetPluginCommonDirectory(plugin_dirs, false); 287 GetPluginCommonDirectory(plugin_dirs, false);
284 } 288 }
285 289
286 void PluginList::GetPluginsInDir( 290 void PluginList::GetPluginsInDir(
287 const base::FilePath& path, std::vector<base::FilePath>* plugins) { 291 const base::FilePath& path, std::vector<base::FilePath>* plugins) {
288 base::FileEnumerator enumerator(path, 292 base::FileEnumerator enumerator(path,
289 false, // not recursive 293 false, // not recursive
290 base::FileEnumerator::DIRECTORIES); 294 base::FileEnumerator::DIRECTORIES);
291 for (base::FilePath path = enumerator.Next(); !path.value().empty(); 295 for (base::FilePath path = enumerator.Next(); !path.value().empty();
292 path = enumerator.Next()) { 296 path = enumerator.Next()) {
293 plugins->push_back(path); 297 plugins->push_back(path);
294 } 298 }
295 } 299 }
296 300
297 bool PluginList::ShouldLoadPluginUsingPluginList( 301 bool PluginList::ShouldLoadPluginUsingPluginList(
298 const WebPluginInfo& info, 302 const WebPluginInfo& info,
299 std::vector<webkit::WebPluginInfo>* plugins) { 303 std::vector<webkit::WebPluginInfo>* plugins) {
300 return !IsBlacklistedPlugin(info); 304 return !IsBlacklistedPlugin(info);
301 } 305 }
302 306
303 } // namespace npapi 307 } // namespace npapi
304 } // namespace webkit 308 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/npapi/plugin_list.cc ('k') | webkit/plugins/npapi/plugin_list_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698