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

Unified Diff: chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc

Issue 1610483003: MD Downloads: check for removed files on page load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/ui/webui/md_downloads/md_downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
index 8a811f4fc391ddc7320df141599a841e88672028..59698e65f0cd7638ec867bfd5a0120cbb24fdc70 100644
--- a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
@@ -82,6 +82,7 @@ MdDownloadsDOMHandler::MdDownloadsDOMHandler(
Profile* profile = Profile::FromBrowserContext(
download_manager->GetBrowserContext());
content::URLDataSource::Add(profile, new FileIconSource());
+ CheckForRemovedFiles();
}
MdDownloadsDOMHandler::~MdDownloadsDOMHandler() {
@@ -136,6 +137,7 @@ void MdDownloadsDOMHandler::RenderViewReused(
content::RenderViewHost* render_view_host) {
list_tracker_.Stop();
list_tracker_.Reset();
+ CheckForRemovedFiles();
}
void MdDownloadsDOMHandler::HandleGetDownloads(const base::ListValue* args) {
@@ -409,3 +411,10 @@ content::DownloadItem* MdDownloadsDOMHandler::GetDownloadById(uint32_t id) {
content::WebContents* MdDownloadsDOMHandler::GetWebUIWebContents() {
return web_ui()->GetWebContents();
}
+
+void MdDownloadsDOMHandler::CheckForRemovedFiles() {
+ if (GetMainNotifierManager())
+ GetMainNotifierManager()->CheckForHistoryFilesRemoval();
+ if (GetOriginalNotifierManager())
+ GetOriginalNotifierManager()->CheckForHistoryFilesRemoval();
+}

Powered by Google App Engine
This is Rietveld 408576698