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

Unified Diff: chrome/browser/ui/views/download/download_item_view_md.cc

Issue 2089923002: MD Download items - fix mode checks to include both dangerous and (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/download/download_item_view_md.cc
diff --git a/chrome/browser/ui/views/download/download_item_view_md.cc b/chrome/browser/ui/views/download/download_item_view_md.cc
index 0f0d5c2255a4dc0a2ae0c8c581e58ce48720b4ea..676b1c8807fa7ae0782da203e7a9feb96308e6ec 100644
--- a/chrome/browser/ui/views/download/download_item_view_md.cc
+++ b/chrome/browser/ui/views/download/download_item_view_md.cc
@@ -845,8 +845,8 @@ void DownloadItemViewMd::ShowContextMenuImpl(const gfx::Rect& rect,
void DownloadItemViewMd::HandlePressEvent(const ui::LocatedEvent& event,
bool active_event) {
- // The event should not activate us in dangerous mode.
- if (mode_ == DANGEROUS_MODE)
+ // The event should not activate us in dangerous/malicious mode.
+ if (IsShowingWarningDialog())
return;
// Stop any completion animation.
@@ -862,10 +862,7 @@ void DownloadItemViewMd::HandlePressEvent(const ui::LocatedEvent& event,
void DownloadItemViewMd::HandleClickEvent(const ui::LocatedEvent& event,
bool active_event) {
- // Mouse should not activate us in dangerous mode.
- if (mode_ == DANGEROUS_MODE)
- return;
-
+ // The event should not activate us in dangerous/malicious mode.
if (!active_event || IsShowingWarningDialog())
return;
@@ -913,7 +910,7 @@ void DownloadItemViewMd::ToggleWarningDialog() {
void DownloadItemViewMd::ClearWarningDialog() {
DCHECK(download()->GetDangerType() ==
content::DOWNLOAD_DANGER_TYPE_USER_VALIDATED);
- DCHECK(mode_ == DANGEROUS_MODE || mode_ == MALICIOUS_MODE);
+ DCHECK(IsShowingWarningDialog());
mode_ = NORMAL_MODE;
dropdown_state_ = NORMAL;
« 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