Chromium Code Reviews| Index: chrome/browser/ui/webui/downloads_dom_handler.cc |
| diff --git a/chrome/browser/ui/webui/downloads_dom_handler.cc b/chrome/browser/ui/webui/downloads_dom_handler.cc |
| index d9938b20ff3efc372542ed203fc6d35b00066f37..53d38ef97b3795debb54413fb3947c36ea227d4b 100644 |
| --- a/chrome/browser/ui/webui/downloads_dom_handler.cc |
| +++ b/chrome/browser/ui/webui/downloads_dom_handler.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/i18n/rtl.h" |
| #include "base/i18n/time_formatting.h" |
| #include "base/memory/singleton.h" |
| +#include "base/metrics/field_trial.h" |
| #include "base/metrics/histogram.h" |
| #include "base/prefs/pref_service.h" |
| #include "base/strings/string_piece.h" |
| @@ -167,6 +168,9 @@ DictionaryValue* CreateDownloadItemValue( |
| file_value->SetBoolean("retry", false); // Overridden below if needed. |
| file_value->SetBoolean("resume", download_item->CanResume()); |
| + std::string trial_condition = |
| + base::FieldTrialList::FindFullName(download_util::kFinchTrialName); |
|
Dan Beam
2013/08/09 21:25:02
^ move this
felt
2013/08/09 22:38:03
Done.
|
| + |
| switch (download_item->GetState()) { |
| case content::DownloadItem::IN_PROGRESS: |
| if (download_item->IsDangerous()) { |
| @@ -187,6 +191,18 @@ DictionaryValue* CreateDownloadItemValue( |
| const char* danger_type_value = |
| GetDangerTypeString(download_item->GetDangerType()); |
| file_value->SetString("danger_type", danger_type_value); |
|
Dan Beam
2013/08/09 21:25:02
to here (as low as possible, there's no reason to
felt
2013/08/09 22:38:03
Done.
|
| + if (!trial_condition.empty()) { |
| + string16 finch_string; |
| + content::DownloadDangerType danger_type = |
| + download_item->GetDangerType(); |
| + if (danger_type == content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL || |
| + danger_type == content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT || |
| + danger_type == content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST) { |
| + finch_string = download_util::AssembleMalwareFinchString( |
| + trial_condition, file_name); |
| + } |
| + file_value->SetString("finch_string", finch_string); |
| + } |
| } else if (download_item->IsPaused()) { |
| file_value->SetString("state", "PAUSED"); |
| } else { |