diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 19:17:40 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 19:17:40 +0000 |
commit | 0e34d7893a17558b6520f853e63adc5e1cc4aa81 (patch) | |
tree | 2c61dfebb2207fddee26991e5d06f95cf37e66e7 /chrome/browser/extensions/extensions_service.cc | |
parent | e5f72c76f42ca9163a6691191ae0b1f471e81952 (diff) | |
download | chromium_src-0e34d7893a17558b6520f853e63adc5e1cc4aa81.zip chromium_src-0e34d7893a17558b6520f853e63adc5e1cc4aa81.tar.gz chromium_src-0e34d7893a17558b6520f853e63adc5e1cc4aa81.tar.bz2 |
Don't prompt before installing a Theme, move existing prompt so that users aren't prompted twice in the case when they have extensions disabled.
Theme installation confirmation will be done through an infobar (allowing you to preview a lot of themes quickly without dealing with dialogs) - see CL 119235.
BUG=none
TEST=Install a theme, verify that you don't get prompted. Install an extension and verify that you do get prompted.
Review URL: http://codereview.chromium.org/119232
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service.cc')
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 4d0f4f5..87c14a2 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -222,7 +222,7 @@ ExtensionsService::ExtensionsService(Profile* profile, extensions_enabled_( CommandLine::ForCurrentProcess()-> HasSwitch(switches::kEnableExtensions)), - show_extensions_disabled_notification_(true), + show_extensions_prompts_(true), backend_(new ExtensionsServiceBackend( install_directory_, g_browser_process->resource_dispatcher_host(), frontend_loop, registry_path)) { @@ -747,7 +747,7 @@ void ExtensionsServiceBackend::InstallExtension( LOG(INFO) << "Installing extension " << extension_path.value(); frontend_ = frontend; - alert_on_error_ = false; + alert_on_error_ = true; bool from_external = false; InstallOrUpdateExtension(extension_path, std::string(), from_external); @@ -779,7 +779,7 @@ void ExtensionsServiceBackend::OnExtensionUnpacked( if (!frontend_->extensions_enabled() && !extension.IsTheme()) { #if defined(OS_WIN) - if (frontend_->show_extensions_disabled_notification()) { + if (frontend_->show_extensions_prompts()) { win_util::MessageBox(GetActiveWindow(), L"Extensions are not enabled. Add --enable-extensions to the " L"command-line to enable extensions.\n\n" @@ -793,6 +793,21 @@ void ExtensionsServiceBackend::OnExtensionUnpacked( return; } +#if defined(OS_WIN) + if (!extension.IsTheme() && + frontend_->show_extensions_prompts() && + win_util::MessageBox(GetActiveWindow(), + L"Are you sure you want to install this extension?\n\n" + L"This is a temporary message and it will be removed when extensions " + L"UI is finalized.", + l10n_util::GetString(IDS_PRODUCT_NAME).c_str(), + MB_OKCANCEL) == IDOK) { + ReportExtensionInstallError(extension_path, + "User did not allow extension to be installed."); + return; + } +#endif + // If an expected id was provided, make sure it matches. if (!expected_id.empty() && expected_id != extension.id()) { ReportExtensionInstallError(extension_path, |