Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index e8f0e9584a4e1c45f4e7df703984ea31b30a9520..c571cb749e5e7427f6144542c811c61d56e988d0 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -12,6 +12,7 @@ |
#include "base/file_util.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/path_service.h" |
+#include "base/string_tokenizer.h" |
#include "base/string_util.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/autocomplete/autocomplete_classifier.h" |
@@ -398,6 +399,13 @@ void ProfileImpl::DoFinalInit() { |
content::NotificationService::NoDetails()); |
} |
+static void AddOrReplaceComponentExtension(extensions::ComponentLoader* loader, |
Aaron Boodman
2011/12/06 19:43:35
Why did you pull this out into a function? It's no
SeRya
2011/12/06 22:19:37
Reverted this change.
|
+ FilePath const& path) { |
+ // Load the component extension manifest synchronously. |
+ base::ThreadRestrictions::ScopedAllowIO allow_io; |
Aaron Boodman
2011/12/06 19:43:35
This is still making me nervous. Since you are alr
SeRya
2011/12/06 22:19:37
I will try to figure out why it did work, but the
|
+ loader->AddOrReplace(path); |
+} |
+ |
void ProfileImpl::InitExtensions(bool extensions_enabled) { |
if (user_script_master_ || extension_service_.get()) |
return; // Already initialized. |
@@ -436,6 +444,17 @@ void ProfileImpl::InitExtensions(bool extensions_enabled) { |
extensions_enabled)); |
extension_service_->component_loader()->AddDefaultComponentExtensions(); |
+ if (command_line->HasSwitch(switches::kLoadComponentExtension)) { |
+ CommandLine::StringType path_list = command_line->GetSwitchValueNative( |
+ switches::kLoadComponentExtension); |
+ StringTokenizerT<CommandLine::StringType, |
+ CommandLine::StringType::const_iterator> t(path_list, |
+ FILE_PATH_LITERAL(",")); |
+ while (t.GetNext()) { |
+ AddOrReplaceComponentExtension( |
+ extension_service_->component_loader(), FilePath(t.token())); |
+ } |
+ } |
extension_service_->Init(); |
if (extensions_enabled) { |