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

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

Issue 2164723002: Change Dismiss button to Discard and cancel download (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove IDS_DISMISS_DOWNLOAD from generated_resources.grd Created 4 years, 5 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
Index: chrome/browser/ui/views/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 1253d748cde3858a22f0a5c158fff4d5c597d4f3..2a5ab60a301075cda0cab10405c398b27cd6df71 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -559,18 +559,8 @@ void DownloadItemView::ButtonPressed(views::Button* sender,
// WARNING: all end states after this point delete |this|.
DCHECK_EQ(discard_button_, sender);
- if (model_.IsMalicious()) {
- UMA_HISTOGRAM_LONG_TIMES("clickjacking.dismiss_download", warning_duration);
- // ExperienceSampling: User chose to dismiss the dangerous download.
- if (sampling_event_.get()) {
- sampling_event_->CreateUserDecisionEvent(ExperienceSamplingEvent::kDeny);
- sampling_event_.reset(NULL);
- }
- shelf_->RemoveDownloadView(this);
- return;
- }
UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", warning_duration);
- if (model_.ShouldAllowDownloadFeedback() &&
+ if (!model_.IsMalicious() && model_.ShouldAllowDownloadFeedback() &&
!shelf_->browser()->profile()->IsOffTheRecord()) {
if (!shelf_->browser()->profile()->GetPrefs()->HasPrefPath(
prefs::kSafeBrowsingExtendedReportingEnabled)) {
@@ -1198,10 +1188,8 @@ void DownloadItemView::ShowWarningDialog() {
save_button_->SetStyle(views::Button::STYLE_BUTTON);
AddChildView(save_button_);
}
- int discard_button_message = model_.IsMalicious() ?
- IDS_DISMISS_DOWNLOAD : IDS_DISCARD_DOWNLOAD;
discard_button_ = new views::LabelButton(
- this, l10n_util::GetStringUTF16(discard_button_message));
+ this, l10n_util::GetStringUTF16(IDS_DISCARD_DOWNLOAD));
discard_button_->SetStyle(views::Button::STYLE_BUTTON);
AddChildView(discard_button_);

Powered by Google App Engine
This is Rietveld 408576698