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

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

Issue 132045: Re-enable the --enable-extensions flag. Fix a bunch of bugs (Closed)
Patch Set: unblech Created 11 years, 6 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
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 7960664fbe73bc1307685d2810662330f3db79ec..4ef4d086f63473c6ac60be70f33c9e63b3e35ecd 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -211,6 +211,7 @@ class ExtensionsServiceBackend::UnpackerClient
};
ExtensionsService::ExtensionsService(Profile* profile,
+ const CommandLine* command_line,
MessageLoop* frontend_loop,
MessageLoop* backend_loop)
: extension_prefs_(new ExtensionPrefs(profile->GetPrefs())),
@@ -219,6 +220,12 @@ ExtensionsService::ExtensionsService(Profile* profile,
extensions_enabled_(false),
show_extensions_prompts_(true),
ready_(false) {
+ // Figure out if extension installation should be enabled.
+ if (command_line->HasSwitch(switches::kEnableExtensions))
+ extensions_enabled_ = true;
+ else if (profile->GetPrefs()->GetBoolean(prefs::kEnableExtensions))
+ extensions_enabled_ = true;
+
// We pass ownership of this object to the Backend.
DictionaryValue* extensions = extension_prefs_->CopyCurrentExtensions();
backend_ = new ExtensionsServiceBackend(
@@ -463,7 +470,7 @@ ExtensionsServiceBackend::ExtensionsServiceBackend(
resource_dispatcher_host_(rdh),
alert_on_error_(false),
frontend_loop_(frontend_loop),
- extensions_enabled_(false) {
+ extensions_enabled_(extensions_enabled) {
external_extension_providers_[Extension::EXTERNAL_PREF] =
linked_ptr<ExternalExtensionProvider>(
new ExternalPrefExtensionProvider(extension_prefs));
@@ -972,11 +979,15 @@ void ExtensionsServiceBackend::OnExtensionUnpacked(
!extension.IsTheme() &&
location != Extension::EXTERNAL_REGISTRY) {
ReportExtensionInstallError(extension_path,
- "Extensions are not enabled (yet!)");
+ "Extensions are not enabled. Add --enable-extensions to the "
+ "command-line to enable extensions.\n\n"
+ "This is a temporary message and it will be removed when extensions "
+ "UI is finalized.");
return;
}
#if defined(OS_WIN)
+ // We don't show the install dialog for themes or external extensions.
if (!extension.IsTheme() &&
!Extension::IsExternalLocation(location) &&
frontend_->show_extensions_prompts() &&
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/extensions/extensions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698