Skip to content

Commit

Permalink
[M115] Flag-guard updated deep scanning prompt security subpage
Browse files Browse the repository at this point in the history
The updated deep scanning UX was not completed in one milestone, and
therefore should be behind a flag until it can be completed.

This CL adds flag guarding to https://crrev.com/c/4518842

(cherry picked from commit 2eaa9ea)

Bug: 1424527
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4575762
Reviewed-by: Xinghui Lu <xinghuilu@chromium.org>
Reviewed-by: Lily Chen <chlily@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1151303}
Change-Id: I40baed71d0b571025ab64b6718f931c4112b0928
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4581181
Cr-Commit-Position: refs/branch-heads/5790@{#394}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
Daniel Rubery authored and Chromium LUCI CQ committed Jun 6, 2023
1 parent b4170d9 commit 9e8b218
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 17 deletions.
4 changes: 4 additions & 0 deletions chrome/app/chromium_strings.grd
Expand Up @@ -660,6 +660,10 @@ Permissions you've already given to websites and apps may apply to this account.
desc="Subpage summary for malware warning for the user.">
Chromium blocked this file because it has malware
</message>
<message name="IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_DEEP_SCANNING_PROMPT"
desc="Subpage summary of warning for Deep Scanning.">
Chromium recommends scanning this file because it may be dangerous
</message>

<!-- Tailored Warning in Download Bubble Items -->
<message name="IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_SUSPICIOUS_ARCHIVE"
Expand Down
@@ -0,0 +1 @@
a1014828ef495bc9f080b0a91ceb7dc637919ab9
12 changes: 10 additions & 2 deletions chrome/app/generated_resources.grd
Expand Up @@ -2705,10 +2705,18 @@ are declared in tools/grit/grit_rule.gni.
</message>
<message name="IDS_DOWNLOAD_BUBBLE_SCAN"
desc="Label for the button prompting for Deep Scanning">
Scan for malware
Scan
</message>
<message name="IDS_DOWNLOAD_BUBBLE_OPEN"
desc="Label for the button prompting to bypass Deep Scanning">
Open
</message>
<message name="IDS_DOWNLOAD_BUBBLE_SCAN_UPDATED"
desc="Label for the button prompting for Deep Scanning">
Scan for malware
</message>
<message name="IDS_DOWNLOAD_BUBBLE_OPEN_UPDATED"
desc="Label for the button prompting to bypass Deep Scanning">
Open anyway
</message>
<message name="IDS_DOWNLOAD_BUBBLE_OPEN_NOW"
Expand Down Expand Up @@ -2847,7 +2855,7 @@ are declared in tools/grit/grit_rule.gni.
desc="Subpage summary of warning for a file blocked for being too large.">
Your organization blocked this file because it is too big for a security check. You can open files up to 50 MB.
</message>
<message name="IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_DEEP_SCANNING_PROMPT"
<message name="IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_DEEP_SCANNING_PROMPT_UPDATED"
desc="Subpage summary of warning for a file where we recommend sending the file for deep scanning.">
This file might be a virus or malware.

Expand Down
@@ -1 +1 @@
1b4a9021d96b254fb17691396a645c22dae1b09e
d6022e110b8cd372844715e36de245c0833fce19
@@ -0,0 +1 @@
1b4a9021d96b254fb17691396a645c22dae1b09e
@@ -1 +1 @@
1b4a9021d96b254fb17691396a645c22dae1b09e
d6022e110b8cd372844715e36de245c0833fce19
@@ -0,0 +1 @@
1b4a9021d96b254fb17691396a645c22dae1b09e
5 changes: 5 additions & 0 deletions chrome/app/google_chrome_strings.grd
Expand Up @@ -683,6 +683,11 @@ Permissions you've already given to websites and apps may apply to this account.
desc="Subpage summary for malware warning for the user.">
Chrome blocked this file because it has malware
</message>
<message name="IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_DEEP_SCANNING_PROMPT"
desc="Subpage summary of warning for Deep Scanning.">
Chrome recommends scanning this file because it may be dangerous
</message>


<!-- Tailored Warning in Download Bubble Items -->
<message name="IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_SUSPICIOUS_ARCHIVE"
Expand Down
@@ -0,0 +1 @@
a1014828ef495bc9f080b0a91ceb7dc637919ab9
30 changes: 19 additions & 11 deletions chrome/browser/download/download_ui_model.cc
Expand Up @@ -1156,17 +1156,25 @@ DownloadUIModel::GetBubbleUIInfoForInProgressOrComplete(
IDS_DOWNLOAD_BUBBLE_SUBPAGE_SUMMARY_DEEP_SCANNING_PROMPT))
.AddIconAndColor(vector_icons::kNotSecureWarningIcon,
ui::kColorAlertMediumSeverityIcon)
.AddSecondaryTextColor(ui::kColorAlertMediumSeverityText)
.AddPrimarySubpageButton(
l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_SCAN),
DownloadCommands::Command::DEEP_SCAN)
.AddSecondarySubpageButton(
l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_OPEN),
DownloadCommands::Command::BYPASS_DEEP_SCANNING,
ui::kColorButtonForeground);
if (!base::FeatureList::IsEnabled(
safe_browsing::kDeepScanningUpdatedUX)) {
ui_info.AddPrimaryButton(DownloadCommands::Command::DEEP_SCAN);
.AddSecondaryTextColor(ui::kColorAlertMediumSeverityText);
if (base::FeatureList::IsEnabled(safe_browsing::kDeepScanningUpdatedUX)) {
ui_info
.AddPrimarySubpageButton(
l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_SCAN_UPDATED),
DownloadCommands::Command::DEEP_SCAN)
.AddSecondarySubpageButton(
l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_OPEN_UPDATED),
DownloadCommands::Command::BYPASS_DEEP_SCANNING,
ui::kColorButtonForeground);
} else {
ui_info.AddPrimaryButton(DownloadCommands::Command::DEEP_SCAN)
.AddPrimarySubpageButton(
l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_SCAN),
DownloadCommands::Command::DEEP_SCAN)
.AddSecondarySubpageButton(
l10n_util::GetStringUTF16(IDS_DOWNLOAD_BUBBLE_OPEN),
DownloadCommands::Command::BYPASS_DEEP_SCANNING,
ui::kColorAlertMediumSeverityText);
}

return ui_info;
Expand Down
Expand Up @@ -18,6 +18,7 @@
#include "chrome/browser/ui/views/download/bubble/download_toolbar_button_view.h"
#include "chrome/grit/generated_resources.h"
#include "components/download/public/common/download_danger_type.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/strings/grit/components_strings.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
Expand Down Expand Up @@ -165,8 +166,9 @@ void DownloadBubbleSecurityView::UpdateIconAndText() {
checkbox_->SetText(ui_info.checkbox_label);
}

if (model_->GetDangerType() ==
download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_PROMPT_FOR_SCANNING) {
if (model_->GetDangerType() == download::DownloadDangerType::
DOWNLOAD_DANGER_TYPE_PROMPT_FOR_SCANNING &&
base::FeatureList::IsEnabled(safe_browsing::kDeepScanningUpdatedUX)) {
size_t link_offset;
std::u16string link_text = l10n_util::GetStringUTF16(
IDS_DOWNLOAD_BUBBLE_SUBPAGE_DEEP_SCANNING_LINK);
Expand Down

0 comments on commit 9e8b218

Please sign in to comment.