summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 23:09:16 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 23:09:16 +0000
commit6dfbbf8d24de61a5d607a7c0d002dc51584c7bda (patch)
tree071fbd1a7743c8f250ca4f68bbbbed0b53ba4cc1 /chrome/browser/download
parentc1652ac6c0c9f893368620e4e89ff956693c784a (diff)
downloadchromium_src-6dfbbf8d24de61a5d607a7c0d002dc51584c7bda.zip
chromium_src-6dfbbf8d24de61a5d607a7c0d002dc51584c7bda.tar.gz
chromium_src-6dfbbf8d24de61a5d607a7c0d002dc51584c7bda.tar.bz2
Mechanical refactor of CrxInstaller signatures. This will make
it easier to add additional configuration features to CrxInstaller. Review URL: http://codereview.chromium.org/875003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_manager.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 423f037..e9ead6c 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -1438,28 +1438,23 @@ void DownloadManager::OpenChromeExtension(const FilePath& full_path,
ExtensionsService* service = profile_->GetExtensionsService();
if (service) {
NotificationService* nservice = NotificationService::current();
- GURL nonconst_download_url = download_url;
- nservice->Notify(NotificationType::EXTENSION_READY_FOR_INSTALL,
- Source<DownloadManager>(this),
- Details<GURL>(&nonconst_download_url));
+ GURL nonconst_download_url = download_url;
+ nservice->Notify(NotificationType::EXTENSION_READY_FOR_INSTALL,
+ Source<DownloadManager>(this),
+ Details<GURL>(&nonconst_download_url));
+
+ scoped_refptr<CrxInstaller> installer(
+ new CrxInstaller(service->install_directory(),
+ service,
+ new ExtensionInstallUI(profile_)));
+ installer->set_delete_source(true);
+
if (UserScript::HasUserScriptFileExtension(download_url)) {
- CrxInstaller::InstallUserScript(
- full_path,
- download_url,
- service->install_directory(),
- true, // please delete crx on completion
- service,
- new ExtensionInstallUI(profile_));
+ installer->InstallUserScript(full_path, download_url);
} else {
- CrxInstaller::Start(
- full_path,
- service->install_directory(),
- Extension::INTERNAL,
- "", // no expected id
- true, // please delete crx on completion
- true, // privilege increase allowed
- service,
- new ExtensionInstallUI(profile_));
+ installer->set_allow_privilege_increase(true);
+ installer->set_original_url(download_url);
+ installer->InstallCrx(full_path);
}
} else {
TabContents* contents = NULL;