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

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

Issue 2418813002: [Reland] Refactoring of SBER preference usage (Closed)
Patch Set: Sync Created 4 years, 2 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 | « chrome/browser/ui/views/download/download_feedback_dialog_view.cc ('k') | chrome/common/pref_names.h » ('j') | 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.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index cb32b4cc4b67966a52bf5dca8866de6c718951d9..7cbd005bfa6373da77cca23082734c571e6244c0 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -40,6 +40,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h"
+#include "components/safe_browsing_db/safe_browsing_prefs.h"
#include "content/public/browser/download_danger_type.h"
#include "third_party/icu/source/common/unicode/uchar.h"
#include "ui/accessibility/ax_view_state.h"
@@ -571,20 +572,20 @@ void DownloadItemView::ButtonPressed(views::Button* sender,
// WARNING: all end states after this point delete |this|.
DCHECK_EQ(discard_button_, sender);
UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", warning_duration);
+ Profile* profile = shelf_->browser()->profile();
if (!model_.IsMalicious() && model_.ShouldAllowDownloadFeedback() &&
- !shelf_->browser()->profile()->IsOffTheRecord()) {
- if (!shelf_->browser()->profile()->GetPrefs()->HasPrefPath(
- prefs::kSafeBrowsingExtendedReportingEnabled)) {
+ !profile->IsOffTheRecord()) {
+ if (!profile->GetPrefs()->HasPrefPath(
+ safe_browsing::GetExtendedReportingPrefName())) {
// Show dialog, because the dialog hasn't been shown before.
DownloadFeedbackDialogView::Show(
- shelf_->get_parent()->GetNativeWindow(), shelf_->browser()->profile(),
+ shelf_->get_parent()->GetNativeWindow(), profile,
shelf_->GetNavigator(),
base::Bind(&DownloadItemView::PossiblySubmitDownloadToFeedbackService,
weak_ptr_factory_.GetWeakPtr()));
} else {
PossiblySubmitDownloadToFeedbackService(
- shelf_->browser()->profile()->GetPrefs()->GetBoolean(
- prefs::kSafeBrowsingExtendedReportingEnabled));
+ safe_browsing::IsExtendedReportingEnabled(*profile->GetPrefs()));
}
return;
}
« no previous file with comments | « chrome/browser/ui/views/download/download_feedback_dialog_view.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698