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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 8414007: Rearrange Should*Download delegate calls to be more useful and intuitive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to TOT. Created 9 years, 2 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/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 690ae50e3d3b86474bc4b5da7a02d1ce4a7087f1..f0145e041867b16ec2843c4b05ed711e3fdcb7cb 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -144,15 +144,11 @@ bool ChromeDownloadManagerDelegate::ShouldOpenFileBasedOnExtension(
return download_prefs_->IsAutoOpenEnabledForExtension(extension);
}
-bool ChromeDownloadManagerDelegate::ShouldOpenDownload(DownloadItem* item) {
- if (!IsExtensionDownload(item))
- return true;
-
- download_crx_util::OpenChromeExtension(profile_, *item);
- return false;
+bool ChromeDownloadManagerDelegate::ShouldCompleteDownload(DownloadItem* item) {
+ return true;
}
-bool ChromeDownloadManagerDelegate::ShouldCompleteDownload(DownloadItem* item) {
+bool ChromeDownloadManagerDelegate::ShouldOpenDownload(DownloadItem* item) {
if (!IsExtensionDownload(item)) {
#if defined(ENABLE_SAFE_BROWSING)
// Begin the safe browsing download protection check.
@@ -179,7 +175,7 @@ bool ChromeDownloadManagerDelegate::ShouldCompleteDownload(DownloadItem* item) {
download_crx_util::OpenChromeExtension(profile_, *item);
// CRX_INSTALLER_DONE will fire when the install completes. Observe()
- // will call CompleteDelayedDownload() on this item. If this DownloadItem is
+ // will call DelayedDownloadOpened() on this item. If this DownloadItem is
// not around when CRX_INSTALLER_DONE fires, Complete() will not be called.
registrar_.Add(this,
chrome::NOTIFICATION_CRX_INSTALLER_DONE,
@@ -344,7 +340,7 @@ void ChromeDownloadManagerDelegate::Observe(
DownloadItem* item = download_manager_->GetActiveDownloadItem(download_id);
if (item)
- item->CompleteDelayedDownload();
+ item->DelayedDownloadOpened();
}
void ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone(
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.h ('k') | content/browser/download/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698