| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/android/deferred_download_observer.h" | |
| 6 | |
| 7 #include <memory> | |
| 8 | |
| 9 #include "content/browser/android/download_controller_android_impl.h" | |
| 10 #include "content/public/browser/web_contents.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 DeferredDownloadObserver::DeferredDownloadObserver( | |
| 15 WebContents* web_contents, | |
| 16 const base::Closure& deferred_download_cb) | |
| 17 : WebContentsObserver(web_contents), | |
| 18 deferred_download_cb_(deferred_download_cb) { | |
| 19 } | |
| 20 | |
| 21 DeferredDownloadObserver::~DeferredDownloadObserver() {} | |
| 22 | |
| 23 void DeferredDownloadObserver::WasShown() { | |
| 24 deferred_download_cb_.Run(); | |
| 25 DownloadControllerAndroidImpl::GetInstance()->CancelDeferredDownload(this); | |
| 26 } | |
| 27 | |
| 28 void DeferredDownloadObserver::WebContentsDestroyed() { | |
| 29 DownloadControllerAndroidImpl::GetInstance()->CancelDeferredDownload(this); | |
| 30 } | |
| 31 | |
| 32 } // namespace content | |
| OLD | NEW |