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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 2680883003: Temporarily re-introduce load-component-extension switch. (Closed)
Patch Set: fix final review comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 873462906484aa1d576d377cdb8593ac7825bb65..7a283b58138b0caa20f76fe9d913e34e5135b120 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -137,6 +137,10 @@ namespace {
// Wait this many seconds after an extensions becomes idle before updating it.
const int kUpdateIdleDelay = 5;
+// Comma-separated list of directories with extensions to load.
+// TODO(samuong): Remove this in M58 (see comment in ExtensionService::Init).
+const char kDeprecatedLoadComponentExtension[] = "load-component-extension";
+
} // namespace
// ExtensionService.
@@ -439,6 +443,20 @@ void ExtensionService::Init() {
LoadExtensionsFromCommandLineFlag(switches::kDisableExtensionsExcept);
if (extensions_enabled_)
LoadExtensionsFromCommandLineFlag(switches::kLoadExtension);
+ // ChromeDriver has no way of determining the Chrome version until after
+ // launch, so it needs to continue passing load-component-extension until it
+ // stops supporting Chrome 56 (when M58 is released). These extensions are
+ // loaded as regular extensions, not component extensions, and are thus safe.
+ // TODO(samuong): Remove this when we release Chrome 58 to stable channel.
+ if (command_line_->HasSwitch(switches::kEnableAutomation) &&
+ command_line_->HasSwitch(kDeprecatedLoadComponentExtension)) {
+ LOG(WARNING) << "Loading extension specified by "
+ "--load-component-extension as a regular extension. "
+ "Extensions specified by --load-component-extension will "
+ "not be loaded starting in M58. Use --load-extension or "
+ "--disable-extensions-except.";
+ LoadExtensionsFromCommandLineFlag(kDeprecatedLoadComponentExtension);
+ }
EnabledReloadableExtensions();
MaybeFinishShutdownDelayed();
SetReadyAndNotifyListeners();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698