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

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

Issue 11711003: Remove the DownloadItem::TogglePause() interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_shelf_context_menu.h" 5 #include "chrome/browser/download/download_shelf_context_menu.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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 prefs->DisableAutoOpenBasedOnExtension(path); 109 prefs->DisableAutoOpenBasedOnExtension(path);
110 break; 110 break;
111 } 111 }
112 case CANCEL: 112 case CANCEL:
113 download_model_->CancelTask(); 113 download_model_->CancelTask();
114 break; 114 break;
115 case TOGGLE_PAUSE: 115 case TOGGLE_PAUSE:
116 // It is possible for the download to complete before the user clicks the 116 // It is possible for the download to complete before the user clicks the
117 // menu item, recheck if the download is in progress state before toggling 117 // menu item, recheck if the download is in progress state before toggling
118 // pause. 118 // pause.
119 if (download_item_->IsPartialDownload()) 119 if (download_item_->IsPartialDownload()) {
120 download_item_->TogglePause(); 120 if (download_item_->IsPaused())
121 download_item_->Resume();
122 else
123 download_item_->Pause();
124 }
121 break; 125 break;
122 case DISCARD: 126 case DISCARD:
123 download_item_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 127 download_item_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD);
124 break; 128 break;
125 case KEEP: 129 case KEEP:
126 download_item_->DangerousDownloadValidated(); 130 download_item_->DangerousDownloadValidated();
127 break; 131 break;
128 case LEARN_MORE_SCANNING: { 132 case LEARN_MORE_SCANNING: {
129 #if defined(FULL_SAFE_BROWSING) 133 #if defined(FULL_SAFE_BROWSING)
130 using safe_browsing::DownloadProtectionService; 134 using safe_browsing::DownloadProtectionService;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 malicious_download_menu_model_->AddItemWithStringId( 269 malicious_download_menu_model_->AddItemWithStringId(
266 DISCARD, IDS_DOWNLOAD_MENU_DISCARD); 270 DISCARD, IDS_DOWNLOAD_MENU_DISCARD);
267 malicious_download_menu_model_->AddItemWithStringId( 271 malicious_download_menu_model_->AddItemWithStringId(
268 KEEP, IDS_DOWNLOAD_MENU_KEEP); 272 KEEP, IDS_DOWNLOAD_MENU_KEEP);
269 malicious_download_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 273 malicious_download_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
270 malicious_download_menu_model_->AddItemWithStringId( 274 malicious_download_menu_model_->AddItemWithStringId(
271 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING); 275 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING);
272 276
273 return malicious_download_menu_model_.get(); 277 return malicious_download_menu_model_.get();
274 } 278 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698