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

Side by Side Diff: chrome/browser/download/download_commands.cc

Issue 991753002: [Download] Fix the wrong condition to enable/disable "Resume" menuitem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698