| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/download/download_controller.h" | 5 #include "chrome/browser/android/download/download_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/android/context_utils.h" | 10 #include "base/android/context_utils.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 WebContents* web_contents, | 417 WebContents* web_contents, |
| 418 const std::string& download_guid, | 418 const std::string& download_guid, |
| 419 bool accept) { | 419 bool accept) { |
| 420 if (!web_contents) | 420 if (!web_contents) |
| 421 return; | 421 return; |
| 422 DownloadManager* dlm = | 422 DownloadManager* dlm = |
| 423 BrowserContext::GetDownloadManager(web_contents->GetBrowserContext()); | 423 BrowserContext::GetDownloadManager(web_contents->GetBrowserContext()); |
| 424 DownloadItem* item = dlm->GetDownloadByGuid(download_guid); | 424 DownloadItem* item = dlm->GetDownloadByGuid(download_guid); |
| 425 if (!item) | 425 if (!item) |
| 426 return; | 426 return; |
| 427 if (accept) | 427 if (accept) { |
| 428 item->ValidateDangerousDownload(); | 428 item->ValidateDangerousDownload(); |
| 429 else | 429 } else { |
| 430 DownloadController::RecordDownloadCancelReason( |
| 431 DownloadController::CANCEL_REASON_DANGEROUS_INFOBAR_DISMISSED); |
| 430 item->Remove(); | 432 item->Remove(); |
| 433 } |
| 431 } | 434 } |
| OLD | NEW |