Chromium Code Reviews| 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..a2e8d98ce64a5102d9c6e1b85f87aa87cb2eb2ac 100644 |
| --- a/components/offline_pages/downloads/download_notifying_observer.cc |
| +++ b/components/offline_pages/downloads/download_notifying_observer.cc |
| @@ -47,7 +47,16 @@ void DownloadNotifyingObserver::OnAdded(const SavePageRequest& request) { |
| DCHECK(notifier_.get()); |
| if (!IsVisibleInUI(request.client_id())) |
| return; |
| + |
| + // There is no Added call for the notifier so we perform a Progress call |
| + // to cause the notification to be created. |
| notifier_->NotifyDownloadProgress(DownloadUIItem(request)); |
| + |
| + // Now if the request state is available, we need to send Interrupted call. |
| + // TODO(dougarnett): Handle request state in notifier impl so this call |
| + // is not needed. |
| + if (request.request_state() == SavePageRequest::RequestState::AVAILABLE) |
|
fgorski
2016/11/28 22:30:24
Here is the response to your previous comment that
dougarnett
2016/11/28 22:52:15
Done.
Btw, chatted with Min and he does suggest g
|
| + notifier_->NotifyDownloadInterrupted(DownloadUIItem(request)); |
| } |
| void DownloadNotifyingObserver::OnChanged(const SavePageRequest& request) { |
| @@ -56,6 +65,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)); |
| } |