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(); |