Speculative fix for default apps failing to remain installed after the first run.

Don't provide external extensions in the import process.

BUG=108286
TEST=Start chrome with first run, see if default apps are installed. Restart chrome and see if they're still installed.

Review URL: http://codereview.chromium.org/9016045

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115857 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 85bc190..5a58bd9c2 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -433,8 +433,11 @@
   app_notification_manager_->Init();
 
   if (extensions_enabled_) {
-    ExternalExtensionProviderImpl::CreateExternalProviders(
-        this, profile_, &external_extension_providers_);
+    if (!command_line->HasSwitch(switches::kImport) &&
+        !command_line->HasSwitch(switches::kImportFromFile)) {
+      ExternalExtensionProviderImpl::CreateExternalProviders(
+          this, profile_, &external_extension_providers_);
+    }
   }
 
   // Use monochrome icons for Omnibox icons.
@@ -558,7 +561,8 @@
   // that is already running an extension service for this profile.
   // TODO(aa): can we start up even less of ExtensionService?
   // http://crbug.com/107636
-  if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kImport)) {
+  if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kImport) &&
+      !CommandLine::ForCurrentProcess()->HasSwitch(switches::kImportFromFile)) {
     // TODO(erikkay) this should probably be deferred to a future point
     // rather than running immediately at startup.
     CheckForExternalUpdates();