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

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: Tweaked comment. 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 d524121dea240f3c3bf1f0a327a712678ecea8ed..20208ddabd4b79eb523730bc9d643b0300676ca8 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -147,15 +147,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))
return true;
@@ -163,7 +159,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,
@@ -322,7 +318,7 @@ void ChromeDownloadManagerDelegate::Observe(
DownloadItem* item = download_manager_->GetActiveDownloadItem(download_id);
if (item)
- item->CompleteDelayedDownload();
+ item->DelayedDownloadOpened();
}
void ChromeDownloadManagerDelegate::CheckVisitedReferrerBeforeDone(

Powered by Google App Engine
This is Rietveld 408576698