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

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

Issue 147593002: Implement new dangerous download reporting dialog for UNCOMMON_DOWNLOAD, in Views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 6 years, 10 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 (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 "base/command_line.h" 7 #include "base/command_line.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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 return interrupted_download_menu_model_.get(); 343 return interrupted_download_menu_model_.get();
344 } 344 }
345 345
346 ui::SimpleMenuModel* DownloadShelfContextMenu::GetMaybeMaliciousMenuModel() { 346 ui::SimpleMenuModel* DownloadShelfContextMenu::GetMaybeMaliciousMenuModel() {
347 if (maybe_malicious_download_menu_model_) 347 if (maybe_malicious_download_menu_model_)
348 return maybe_malicious_download_menu_model_.get(); 348 return maybe_malicious_download_menu_model_.get();
349 349
350 maybe_malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this)); 350 maybe_malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this));
351 351
352 maybe_malicious_download_menu_model_->AddItemWithStringId( 352 maybe_malicious_download_menu_model_->AddItemWithStringId(
353 DISCARD, IDS_DOWNLOAD_MENU_DISCARD);
354 maybe_malicious_download_menu_model_->AddItemWithStringId(
Peter Kasting 2014/02/04 21:56:33 How come we removed this?
felt 2014/02/04 23:37:22 Previously, the main button said "Report & Discard
355 KEEP, IDS_DOWNLOAD_MENU_KEEP); 353 KEEP, IDS_DOWNLOAD_MENU_KEEP);
356 maybe_malicious_download_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 354 maybe_malicious_download_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
357 maybe_malicious_download_menu_model_->AddItemWithStringId( 355 maybe_malicious_download_menu_model_->AddItemWithStringId(
358 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING); 356 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING);
359 return maybe_malicious_download_menu_model_.get(); 357 return maybe_malicious_download_menu_model_.get();
360 } 358 }
361 359
362 ui::SimpleMenuModel* 360 ui::SimpleMenuModel*
363 DownloadShelfContextMenu::GetMaliciousMenuModel() { 361 DownloadShelfContextMenu::GetMaliciousMenuModel() {
364 if (malicious_download_menu_model_) 362 if (malicious_download_menu_model_)
365 return malicious_download_menu_model_.get(); 363 return malicious_download_menu_model_.get();
366 364
367 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this)); 365 malicious_download_menu_model_.reset(new ui::SimpleMenuModel(this));
368 366
369 DownloadItemModel download_model(download_item_); 367 DownloadItemModel download_model(download_item_);
370 if (download_model.ShouldAllowDownloadFeedback()) { 368 if (download_model.ShouldAllowDownloadFeedback()) {
371 malicious_download_menu_model_->AddItemWithStringId( 369 malicious_download_menu_model_->AddItemWithStringId(
372 REPORT, IDS_DOWNLOAD_MENU_REPORT); 370 REPORT, IDS_DOWNLOAD_MENU_REPORT);
373 } 371 }
374 malicious_download_menu_model_->AddItemWithStringId( 372 malicious_download_menu_model_->AddItemWithStringId(
375 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING); 373 LEARN_MORE_SCANNING, IDS_DOWNLOAD_MENU_LEARN_MORE_SCANNING);
376 374
377 return malicious_download_menu_model_.get(); 375 return malicious_download_menu_model_.get();
378 } 376 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698