| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/download/download_commands.h" | 5 #include "chrome/browser/download/download_commands.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/download/download_crx_util.h" | 8 #include "chrome/browser/download/download_crx_util.h" |
| 9 #include "chrome/browser/download/download_item_model.h" | 9 #include "chrome/browser/download/download_item_model.h" |
| 10 #include "chrome/browser/download/download_prefs.h" | 10 #include "chrome/browser/download/download_prefs.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // filename. Don't base an "Always open" decision based on it. Also | 72 // filename. Don't base an "Always open" decision based on it. Also |
| 73 // exclude extensions. | 73 // exclude extensions. |
| 74 return download_item_->CanOpenDownload() && | 74 return download_item_->CanOpenDownload() && |
| 75 !download_crx_util::IsExtensionDownload(*download_item_); | 75 !download_crx_util::IsExtensionDownload(*download_item_); |
| 76 case CANCEL: | 76 case CANCEL: |
| 77 return !download_item_->IsDone(); | 77 return !download_item_->IsDone(); |
| 78 case PAUSE: | 78 case PAUSE: |
| 79 return !download_item_->IsDone() && !download_item_->IsPaused() && | 79 return !download_item_->IsDone() && !download_item_->IsPaused() && |
| 80 download_item_->GetState() == content::DownloadItem::IN_PROGRESS; | 80 download_item_->GetState() == content::DownloadItem::IN_PROGRESS; |
| 81 case RESUME: | 81 case RESUME: |
| 82 return !download_item_->CanResume() && | 82 return download_item_->CanResume() && |
| 83 (download_item_->IsPaused() || | 83 (download_item_->IsPaused() || |
| 84 download_item_->GetState() != content::DownloadItem::IN_PROGRESS); | 84 download_item_->GetState() != content::DownloadItem::IN_PROGRESS); |
| 85 case DISCARD: | 85 case DISCARD: |
| 86 case KEEP: | 86 case KEEP: |
| 87 case LEARN_MORE_SCANNING: | 87 case LEARN_MORE_SCANNING: |
| 88 case LEARN_MORE_INTERRUPTED: | 88 case LEARN_MORE_INTERRUPTED: |
| 89 case RETRY: | 89 case RETRY: |
| 90 return true; | 90 return true; |
| 91 } | 91 } |
| 92 NOTREACHED(); | 92 NOTREACHED(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 is_adobe_pdf_reader_up_to_date = | 232 is_adobe_pdf_reader_up_to_date = |
| 233 DownloadTargetDeterminer::IsAdobeReaderUpToDate(); | 233 DownloadTargetDeterminer::IsAdobeReaderUpToDate(); |
| 234 } | 234 } |
| 235 return IsDownloadPdf() && | 235 return IsDownloadPdf() && |
| 236 (IsAdobeReaderDefaultPDFViewer() ? is_adobe_pdf_reader_up_to_date | 236 (IsAdobeReaderDefaultPDFViewer() ? is_adobe_pdf_reader_up_to_date |
| 237 : true); | 237 : true); |
| 238 #elif defined(OS_MACOSX) || defined(OS_LINUX) | 238 #elif defined(OS_MACOSX) || defined(OS_LINUX) |
| 239 return IsDownloadPdf(); | 239 return IsDownloadPdf(); |
| 240 #endif | 240 #endif |
| 241 } | 241 } |
| OLD | NEW |