From d81706b859fa9ec8d48d0f471b6245b36aeac510 Mon Sep 17 00:00:00 2001 From: "georged@chromium.org" Date: Fri, 3 Apr 2009 20:28:44 +0000 Subject: Adds temporary warning when installing Chrome extensions. The warning will be replaced with the final extension installation UI when available. Review URL: http://codereview.chromium.org/60079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13103 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/download/download_manager.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'chrome/browser') diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index 9574096..db76181 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -34,6 +34,7 @@ #include "chrome/common/pref_service.h" #include "chrome/common/stl_util-inl.h" #include "googleurl/src/gurl.h" +#include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "net/base/mime_util.h" #include "net/base/net_util.h" @@ -1233,8 +1234,23 @@ void DownloadManager::OpenDownload(const DownloadItem* download, } void DownloadManager::OpenChromeExtension(const FilePath& full_path) { + // 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 UI " + L"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. ExtensionsService* extensions_service = profile_->GetExtensionsService(); extensions_service->InstallExtension(full_path); +#endif + } void DownloadManager::OpenDownloadInShell(const DownloadItem* download, -- cgit v1.1