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

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

Issue 2029363002: Show dropdown button in download shelf items for malicious DLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 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 25d1cceede768899fdd41ab817e3873eb1bd07f6..a75e20d029cbedc814060f86fc0d79b11181da8a 100644
--- a/chrome/browser/ui/views/download/download_item_view_md.cc
+++ b/chrome/browser/ui/views/download/download_item_view_md.cc
@@ -338,9 +338,9 @@ void DownloadItemViewMd::Layout() {
child_origin.Offset(button_size.width() + kButtonPadding, 0);
}
discard_button_->SetBoundsRect(gfx::Rect(child_origin, button_size));
- DCHECK_EQ(GetPreferredSize().width(),
- discard_button_->bounds().right() + kEndPadding);
- } else {
+ }
+
+ if (mode_ != DANGEROUS_MODE) {
dropdown_button_->SizeToPreferredSize();
dropdown_button_->SetPosition(
gfx::Point(width() - dropdown_button_->width() - kEndPadding,
@@ -368,10 +368,12 @@ gfx::Size DownloadItemViewMd::GetPreferredSize() const {
std::max({child_height, button_size.height(), kWarningIconSize});
} else {
width = kStartPadding + DownloadShelf::kProgressIndicatorSize +
- kProgressTextPadding + kTextWidth +
- dropdown_button_->GetPreferredSize().width() + kEndPadding;
+ kProgressTextPadding + kTextWidth + kEndPadding;
}
+ if (mode_ != DANGEROUS_MODE)
+ width += dropdown_button_->GetPreferredSize().width();
+
return gfx::Size(width, std::max(kDefaultHeight,
2 * kMinimumVerticalPadding + child_height));
}
@@ -966,7 +968,7 @@ void DownloadItemViewMd::ShowWarningDialog() {
AddChildView(dangerous_download_label_);
SizeLabelToMinWidth();
- dropdown_button_->SetVisible(false);
+ dropdown_button_->SetVisible(mode_ == MALICIOUS_MODE);
}
gfx::ImageSkia DownloadItemViewMd::GetWarningIcon() {
« 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