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

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
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)) {
Bernhard Bauer 2013/06/06 08:28:50 Braces aren't required, and Chromium style is to r
seva 2013/06/06 22:11:25 Done.
201 plugin_list_->DisablePluginsDiscovery();
202 }
199 } 203 }
200 204
201 void PluginServiceImpl::StartWatchingPlugins() { 205 void PluginServiceImpl::StartWatchingPlugins() {
202 // Start watching for changes in the plugin list. This means watching 206 // 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 207 // 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. 208 // watch for changes in the paths that are expected to contain plugins.
205 #if defined(OS_WIN) 209 #if defined(OS_WIN)
206 if (hkcu_key_.Create(HKEY_CURRENT_USER, 210 if (hkcu_key_.Create(HKEY_CURRENT_USER,
207 webkit::npapi::kRegistryMozillaPlugins, 211 webkit::npapi::kRegistryMozillaPlugins,
208 KEY_NOTIFY) == ERROR_SUCCESS) { 212 KEY_NOTIFY) == ERROR_SUCCESS) {
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 void PluginServiceImpl::GetInternalPlugins( 788 void PluginServiceImpl::GetInternalPlugins(
785 std::vector<webkit::WebPluginInfo>* plugins) { 789 std::vector<webkit::WebPluginInfo>* plugins) {
786 plugin_list_->GetInternalPlugins(plugins); 790 plugin_list_->GetInternalPlugins(plugins);
787 } 791 }
788 792
789 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() { 793 webkit::npapi::PluginList* PluginServiceImpl::GetPluginList() {
790 return plugin_list_; 794 return plugin_list_;
791 } 795 }
792 796
793 } // namespace content 797 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698