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

Unified Diff: chrome/browser/ui/webui/active_downloads_ui.cc

Issue 8929026: Do not show downloads panel for temporary downloads. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: header necessary Created 9 years 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
« no previous file with comments | « chrome/browser/ui/webui/active_downloads_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/active_downloads_ui.cc
===================================================================
--- chrome/browser/ui/webui/active_downloads_ui.cc (revision 114400)
+++ chrome/browser/ui/webui/active_downloads_ui.cc (working copy)
@@ -24,10 +24,12 @@
#include "base/values.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/media/media_player.h"
+#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/download/download_service.h"
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/download/download_util.h"
+#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/file_manager_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tabs/tab_strip_model.h"
@@ -370,6 +372,19 @@
}
// static
+bool ActiveDownloadsUI::ShouldShowPopup(Profile* profile,
+ DownloadItem* download) {
+ // Don't show downloads panel for extension/theme downloads from gallery,
+ // or temporary downloads.
+ ExtensionService* service = profile->GetExtensionService();
+ return !download->IsTemporary() &&
+ (!ChromeDownloadManagerDelegate::IsExtensionDownload(download) ||
+ service == NULL ||
+ !service->IsDownloadFromGallery(download->GetURL(),
+ download->GetReferrerUrl()));
+}
+
+// static
Browser* ActiveDownloadsUI::OpenPopup(Profile* profile) {
Browser* browser = GetPopup();
@@ -397,6 +412,7 @@
return browser;
}
+// static
Browser* ActiveDownloadsUI::GetPopup() {
for (BrowserList::const_iterator it = BrowserList::begin();
it != BrowserList::end();
« no previous file with comments | « chrome/browser/ui/webui/active_downloads_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698