Index: chrome/browser/extensions/extension_system_impl.cc |
diff --git a/chrome/browser/extensions/extension_system_impl.cc b/chrome/browser/extensions/extension_system_impl.cc |
index fa7596f5ad8971e9170674d058eb884391aea2e6..cd485317e621ef7f641e5308530ac32903d10f56 100644 |
--- a/chrome/browser/extensions/extension_system_impl.cc |
+++ b/chrome/browser/extensions/extension_system_impl.cc |
@@ -263,6 +263,19 @@ void ExtensionSystemImpl::Shared::Init(bool extensions_enabled) { |
quota_service_.reset(new QuotaService); |
+ if (command_line->HasSwitch(switches::kDisableExtensionsExcept)) { |
+ base::CommandLine::StringType path_list = |
Devlin
2016/07/25 19:10:30
The fact that the next 10 lines are almost identic
catmullings
2016/07/27 01:29:46
Done.
|
+ command_line->GetSwitchValueNative(switches::kDisableExtensionsExcept); |
+ base::StringTokenizerT<base::CommandLine::StringType, |
+ base::CommandLine::StringType::const_iterator> |
+ t(path_list, FILE_PATH_LITERAL(",")); |
+ while (t.GetNext()) { |
+ std::string extension_id; |
+ UnpackedInstaller::Create(extension_service_.get()) |
+ ->LoadFromCommandLine(base::FilePath(t.token()), &extension_id); |
+ extension_service_->AddExtensionToWhitelist(extension_id); |
+ } |
+ } |
if (extensions_enabled) { |
// Load any extensions specified with --load-extension. |
// TODO(yoz): Seems like this should move into ExtensionService::Init. |