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

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

Issue 10915180: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r168573 Created 8 years, 1 month 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/ui/webui/downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc
index 131bcfcc28758fe0e982542a5bfb8ab9cc5c939e..91ff933dd03e5220d45578b0bcd4a75910a6c33c 100644
--- a/chrome/browser/ui/webui/downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/downloads_dom_handler.cc
@@ -200,7 +200,6 @@ DictionaryValue* CreateDownloadItemValue(
// Filters out extension downloads and downloads that don't have a filename yet.
bool IsDownloadDisplayable(const content::DownloadItem& item) {
return (!download_crx_util::IsExtensionDownload(item) &&
- item.IsPersisted() &&
!item.IsTemporary() &&
!item.GetFileNameToReportUser().empty() &&
!item.GetTargetFilePath().empty());
@@ -328,8 +327,6 @@ void DownloadsDOMHandler::HandleGetDownloads(const base::ListValue* args) {
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_GET_DOWNLOADS);
search_text_ = ExtractStringValue(args);
SendCurrentDownloads();
- if (main_notifier_.GetManager())
- main_notifier_.GetManager()->CheckForHistoryFilesRemoval();
}
void DownloadsDOMHandler::HandleOpenFile(const base::ListValue* args) {
@@ -436,10 +433,14 @@ void DownloadsDOMHandler::ScheduleSendCurrentDownloads() {
void DownloadsDOMHandler::SendCurrentDownloads() {
update_scheduled_ = false;
content::DownloadManager::DownloadVector all_items, filtered_items;
- if (main_notifier_.GetManager())
+ if (main_notifier_.GetManager()) {
main_notifier_.GetManager()->GetAllDownloads(&all_items);
- if (original_notifier_.get() && original_notifier_->GetManager())
+ main_notifier_.GetManager()->CheckForHistoryFilesRemoval();
+ }
+ if (original_notifier_.get() && original_notifier_->GetManager()) {
original_notifier_->GetManager()->GetAllDownloads(&all_items);
+ original_notifier_->GetManager()->CheckForHistoryFilesRemoval();
+ }
DownloadQuery query;
if (!search_text_.empty()) {
scoped_ptr<base::Value> query_text(base::Value::CreateStringValue(

Powered by Google App Engine
This is Rietveld 408576698