| Index: chrome/browser/download/download_item_model.cc
|
| diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
|
| index b1c89fca2b294f477212fae55762f12646996472..27c788d24e3c4a3d0c1f1e83b6a991d38be94bef 100644
|
| --- a/chrome/browser/download/download_item_model.cc
|
| +++ b/chrome/browser/download/download_item_model.cc
|
| @@ -6,12 +6,14 @@
|
|
|
| #include "base/i18n/number_formatting.h"
|
| #include "base/i18n/rtl.h"
|
| +#include "base/metrics/field_trial.h"
|
| #include "base/strings/string16.h"
|
| #include "base/strings/sys_string_conversions.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/supports_user_data.h"
|
| #include "base/time/time.h"
|
| #include "chrome/browser/download/download_crx_util.h"
|
| +#include "chrome/browser/download/download_util.h"
|
| #include "chrome/browser/safe_browsing/download_feedback_service.h"
|
| #include "content/public/browser/download_danger_type.h"
|
| #include "content/public/browser/download_interrupt_reasons.h"
|
| @@ -301,12 +303,18 @@ string16 DownloadItemModel::GetWarningText(const gfx::Font& font,
|
| int base_width) const {
|
| // Should only be called if IsDangerous().
|
| DCHECK(IsDangerous());
|
| + std::string trialCondition =
|
| + base::FieldTrialList::FindFullName(download_util::kFinchTrialName);
|
| string16 elided_filename =
|
| ui::ElideFilename(download_->GetFileNameToReportUser(), font, base_width);
|
| switch (download_->GetDangerType()) {
|
| case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL:
|
| - return l10n_util::GetStringUTF16(IDS_PROMPT_MALICIOUS_DOWNLOAD_URL);
|
| -
|
| + if (trialCondition == "") {
|
| + return l10n_util::GetStringUTF16(IDS_PROMPT_MALICIOUS_DOWNLOAD_URL);
|
| + } else {
|
| + return download_util::AssembleMalwareFinchString(trialCondition,
|
| + elided_filename);
|
| + }
|
| case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE:
|
| if (download_crx_util::IsExtensionDownload(*download_)) {
|
| return l10n_util::GetStringUTF16(
|
| @@ -315,12 +323,15 @@ string16 DownloadItemModel::GetWarningText(const gfx::Font& font,
|
| return l10n_util::GetStringFUTF16(IDS_PROMPT_DANGEROUS_DOWNLOAD,
|
| elided_filename);
|
| }
|
| -
|
| case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT:
|
| case content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST:
|
| - return l10n_util::GetStringFUTF16(IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT,
|
| - elided_filename);
|
| -
|
| + if (trialCondition == "") {
|
| + return l10n_util::GetStringFUTF16(IDS_PROMPT_MALICIOUS_DOWNLOAD_CONTENT,
|
| + elided_filename);
|
| + } else {
|
| + return download_util::AssembleMalwareFinchString(trialCondition,
|
| + elided_filename);
|
| + }
|
| case content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT:
|
| return l10n_util::GetStringFUTF16(IDS_PROMPT_UNCOMMON_DOWNLOAD_CONTENT,
|
| elided_filename);
|
|
|