diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:19:54 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:19:54 +0000 |
commit | e2eb43115440dc442b92c5842274290caedb146f (patch) | |
tree | 32fd0e6ceb12b584bfb2e927c4294d9a0a9b96e4 /chrome/browser/download | |
parent | 87a22e7b22583637338dbe55398ae6711430437f (diff) | |
download | chromium_src-e2eb43115440dc442b92c5842274290caedb146f.zip chromium_src-e2eb43115440dc442b92c5842274290caedb146f.tar.gz chromium_src-e2eb43115440dc442b92c5842274290caedb146f.tar.bz2 |
Allow themes to be installed without any commandline flag, still require flag for Extensions. Expand themes unittests.
BUG=12205,12231
TEST=Without any flags, try installing an extension and a theme. The extension should fail and the theme should succeed. Attempts to install a theme with extension components in the manifest should similarly result in failure.
Review URL: http://codereview.chromium.org/115798
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r-- | chrome/browser/download/download_manager.cc | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index 248df33..93cbaed 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -5,7 +5,6 @@ #include "chrome/browser/download/download_manager.h" #include "app/l10n_util.h" -#include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" #include "base/message_loop.h" @@ -29,7 +28,6 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/platform_util.h" #include "chrome/common/pref_names.h" @@ -1230,37 +1228,20 @@ void DownloadManager::OpenDownload(const DownloadItem* download, } void DownloadManager::OpenChromeExtension(const FilePath& full_path) { - if (CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableExtensions)) { - // Temporary: Ask the user if it's okay to install the extension. This - // should be replaced with the actual extension installation UI when it is - // avaiable. #if defined(OS_WIN) - if (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) { - ExtensionsService* extensions_service = profile_->GetExtensionsService(); - extensions_service->InstallExtension(full_path); - } -#else - // TODO(port): Needs CreateChromeWindow. + if (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) { ExtensionsService* extensions_service = profile_->GetExtensionsService(); extensions_service->InstallExtension(full_path); -#endif - } else { -#if defined(OS_WIN) - win_util::MessageBox(GetActiveWindow(), - L"Extensions are not enabled. Add --enable-extensions to the " - L"command-line to enable extensions.\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_OK); + } #else - // TODO(port): Needs CreateChromeWindow + // TODO(port): Needs CreateChromeWindow. + ExtensionsService* extensions_service = profile_->GetExtensionsService(); + extensions_service->InstallExtension(full_path); #endif - } } void DownloadManager::OpenDownloadInShell(const DownloadItem* download, |