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

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

Issue 1087843004: [Download Notification] Refine retry logic when interrupted or cancelled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change retry button behaviour as discussed in mail Created 5 years, 7 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
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 "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/download/download_crx_util.h" 9 #include "chrome/browser/download/download_crx_util.h"
10 #include "chrome/browser/download/download_item_model.h" 10 #include "chrome/browser/download/download_item_model.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 case LEARN_MORE_INTERRUPTED: 208 case LEARN_MORE_INTERRUPTED:
209 GetBrowser()->OpenURL(content::OpenURLParams( 209 GetBrowser()->OpenURL(content::OpenURLParams(
210 GetLearnMoreURLForInterruptedDownload(), content::Referrer(), 210 GetLearnMoreURLForInterruptedDownload(), content::Referrer(),
211 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false)); 211 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false));
212 break; 212 break;
213 case PAUSE: 213 case PAUSE:
214 download_item_->Pause(); 214 download_item_->Pause();
215 break; 215 break;
216 case RESUME: 216 case RESUME:
217 case RETRY:
217 download_item_->Resume(); 218 download_item_->Resume();
218 break; 219 break;
219 case RETRY:
220 if (download_item_->CanResume()) {
221 download_item_->Resume();
222 } else {
223 // TODO(yoshiki): Implement retry logic.
224 }
225 break;
226 } 220 }
227 } 221 }
228 222
229 Browser* DownloadCommands::GetBrowser() const { 223 Browser* DownloadCommands::GetBrowser() const {
230 Profile* profile = 224 Profile* profile =
231 Profile::FromBrowserContext(download_item_->GetBrowserContext()); 225 Profile::FromBrowserContext(download_item_->GetBrowserContext());
232 chrome::ScopedTabbedBrowserDisplayer browser_displayer( 226 chrome::ScopedTabbedBrowserDisplayer browser_displayer(
233 profile, chrome::GetActiveDesktop()); 227 profile, chrome::GetActiveDesktop());
234 DCHECK(browser_displayer.browser()); 228 DCHECK(browser_displayer.browser());
235 return browser_displayer.browser(); 229 return browser_displayer.browser();
(...skipping 13 matching lines...) Expand all
249 is_adobe_pdf_reader_up_to_date = 243 is_adobe_pdf_reader_up_to_date =
250 DownloadTargetDeterminer::IsAdobeReaderUpToDate(); 244 DownloadTargetDeterminer::IsAdobeReaderUpToDate();
251 } 245 }
252 return IsDownloadPdf() && 246 return IsDownloadPdf() &&
253 (IsAdobeReaderDefaultPDFViewer() ? is_adobe_pdf_reader_up_to_date 247 (IsAdobeReaderDefaultPDFViewer() ? is_adobe_pdf_reader_up_to_date
254 : true); 248 : true);
255 #elif defined(OS_MACOSX) || defined(OS_LINUX) 249 #elif defined(OS_MACOSX) || defined(OS_LINUX)
256 return IsDownloadPdf(); 250 return IsDownloadPdf();
257 #endif 251 #endif
258 } 252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698