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

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

Issue 14947007: [Downloads] Allow acquiring dangerous download file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 6 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // menu item, recheck if the download is in progress state before toggling 130 // menu item, recheck if the download is in progress state before toggling
131 // pause. 131 // pause.
132 if (download_item_->IsPartialDownload()) { 132 if (download_item_->IsPartialDownload()) {
133 if (download_item_->IsPaused()) 133 if (download_item_->IsPaused())
134 download_item_->Resume(); 134 download_item_->Resume();
135 else 135 else
136 download_item_->Pause(); 136 download_item_->Pause();
137 } 137 }
138 break; 138 break;
139 case DISCARD: 139 case DISCARD:
140 download_item_->Delete(DownloadItem::DELETE_DUE_TO_USER_DISCARD); 140 download_item_->Remove();
141 break; 141 break;
142 case KEEP: 142 case KEEP:
143 download_item_->DangerousDownloadValidated(); 143 download_item_->ValidateDangerousDownload();
144 break; 144 break;
145 case LEARN_MORE_SCANNING: { 145 case LEARN_MORE_SCANNING: {
146 #if defined(FULL_SAFE_BROWSING) 146 #if defined(FULL_SAFE_BROWSING)
147 using safe_browsing::DownloadProtectionService; 147 using safe_browsing::DownloadProtectionService;
148 SafeBrowsingService* sb_service = 148 SafeBrowsingService* sb_service =
149 g_browser_process->safe_browsing_service(); 149 g_browser_process->safe_browsing_service();
150 DownloadProtectionService* protection_service = 150 DownloadProtectionService* protection_service =
151 (sb_service ? sb_service->download_protection_service() : NULL); 151 (sb_service ? sb_service->download_protection_service() : NULL);
152 if (protection_service) { 152 if (protection_service) {
153 protection_service->ShowDetailsForDownload(*download_item_, navigator_); 153 protection_service->ShowDetailsForDownload(*download_item_, navigator_);
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 malicious_download_menu_model_->AddItemWithStringId( 291 malicious_download_menu_model_->AddItemWithStringId(
292 DISCARD, IDS_DOWNLOAD_MENU_DISCARD); 292 DISCARD, IDS_DOWNLOAD_MENU_DISCARD);
293 malicious_download_menu_model_->AddItemWithStringId( 293 malicious_download_menu_model_->AddItemWithStringId(
294 KEEP, IDS_DOWNLOAD_MENU_KEEP); 294 KEEP, IDS_DOWNLOAD_MENU_KEEP);
295 malicious_download_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 295 malicious_download_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
296 malicious_download_menu_model_->AddItemWithStringId( 296 malicious_download_menu_model_->AddItemWithStringId(
297 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING); 297 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING);
298 298
299 return malicious_download_menu_model_.get(); 299 return malicious_download_menu_model_.get();
300 } 300 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/extensions/api/downloads/downloads_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698