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

Side by Side Diff: content/browser/plugin_service_impl.cc

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 | « chrome/browser/browser_process_impl.cc ('k') | content/public/common/content_switches.h » ('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 "content/browser/plugin_service_impl.h" 5 #include "content/browser/plugin_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 GetContentClient()->AddNPAPIPlugins(plugin_list_); 189 GetContentClient()->AddNPAPIPlugins(plugin_list_);
190 190
191 // Load any specified on the command line as well. 191 // Load any specified on the command line as well.
192 base::FilePath path = 192 base::FilePath path =
193 command_line->GetSwitchValuePath(switches::kLoadPlugin); 193 command_line->GetSwitchValuePath(switches::kLoadPlugin);
194 if (!path.empty()) 194 if (!path.empty())
195 AddExtraPluginPath(path); 195 AddExtraPluginPath(path);
196 path = command_line->GetSwitchValuePath(switches::kExtraPluginDir); 196 path = command_line->GetSwitchValuePath(switches::kExtraPluginDir);
197 if (!path.empty()) 197 if (!path.empty())
198 plugin_list_->AddExtraPluginDir(path); 198 plugin_list_->AddExtraPluginDir(path);
199
200 if (command_line->HasSwitch(switches::kDisablePluginsDiscovery))
201 plugin_list_->DisablePluginsDiscovery();
199 } 202 }
200 203
201 void PluginServiceImpl::StartWatchingPlugins() { 204 void PluginServiceImpl::StartWatchingPlugins() {
202 // Start watching for changes in the plugin list. This means watching 205 // Start watching for changes in the plugin list. This means watching
203 // for changes in the Windows registry keys and on both Windows and POSIX 206 // for changes in the Windows registry keys and on both Windows and POSIX
204 // watch for changes in the paths that are expected to contain plugins. 207 // watch for changes in the paths that are expected to contain plugins.
205 #if defined(OS_WIN) 208 #if defined(OS_WIN)
206 if (hkcu_key_.Create(HKEY_CURRENT_USER, 209 if (hkcu_key_.Create(HKEY_CURRENT_USER,
207 webkit::npapi::kRegistryMozillaPlugins, 210 webkit::npapi::kRegistryMozillaPlugins,
208 KEY_NOTIFY) == ERROR_SUCCESS) { 211 KEY_NOTIFY) == ERROR_SUCCESS) {
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 void PluginServiceImpl::GetInternalPlugins( 787 void PluginServiceImpl::GetInternalPlugins(
785 std::vector<webkit::WebPluginInfo>* plugins) { 788 std::vector<webkit::WebPluginInfo>* plugins) {
786 plugin_list_->GetInternalPlugins(plugins); 789 plugin_list_->GetInternalPlugins(plugins);
787 } 790 }
788 791
789 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { 792 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() {
790 return plugin_list_; 793 return plugin_list_;
791 } 794 }
792 795
793 } // namespace content 796 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698