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

Unified Diff: components/offline_pages/downloads/download_notifying_observer.cc

Issue 2521353005: [OfflinePages] Call NotifyInterrupted for pending requests (Closed)
Patch Set: Fixed OnAdded to handle request_state same as OnChanged Created 4 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
« no previous file with comments | « no previous file | components/offline_pages/downloads/download_notifying_observer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/downloads/download_notifying_observer.cc
diff --git a/components/offline_pages/downloads/download_notifying_observer.cc b/components/offline_pages/downloads/download_notifying_observer.cc
index 397bcc975a867fbd9fff675cb620921857ca9662..3fc561dab9dc772717db1663b6d8cdb7fe017bf6 100644
--- a/components/offline_pages/downloads/download_notifying_observer.cc
+++ b/components/offline_pages/downloads/download_notifying_observer.cc
@@ -44,10 +44,8 @@ void DownloadNotifyingObserver::CreateAndStartObserving(
}
void DownloadNotifyingObserver::OnAdded(const SavePageRequest& request) {
- DCHECK(notifier_.get());
- if (!IsVisibleInUI(request.client_id()))
- return;
- notifier_->NotifyDownloadProgress(DownloadUIItem(request));
+ // Same notifier update as for OnChanged.
+ OnChanged(request);
dougarnett 2016/11/28 21:33:26 Hmm, actually this didn't work. Seems that we need
dougarnett 2016/11/28 22:18:49 Here is one approach at this level to affect the c
}
void DownloadNotifyingObserver::OnChanged(const SavePageRequest& request) {
@@ -56,6 +54,8 @@ void DownloadNotifyingObserver::OnChanged(const SavePageRequest& request) {
return;
if (request.request_state() == SavePageRequest::RequestState::PAUSED)
notifier_->NotifyDownloadPaused(DownloadUIItem(request));
+ else if (request.request_state() == SavePageRequest::RequestState::AVAILABLE)
+ notifier_->NotifyDownloadInterrupted(DownloadUIItem(request));
else
notifier_->NotifyDownloadProgress(DownloadUIItem(request));
}
« no previous file with comments | « no previous file | components/offline_pages/downloads/download_notifying_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698