Skip to content

Commit

Permalink
[M115] Flag-guard updated deep scanning complete UX
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/4517963

(cherry picked from commit b780fda)

Bug: 1424527
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4575562
Auto-Submit: Daniel Rubery <drubery@chromium.org>
Reviewed-by: Xinghui Lu <xinghuilu@chromium.org>
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1150945}
Change-Id: I0f39780463aec719b2c0a12a9923abbd36538896
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4581179
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/branch-heads/5790@{#392}
Cr-Branched-From: 1d71a33-refs/heads/main@{#1148114}
  • Loading branch information
Daniel Rubery authored and Chromium LUCI CQ committed Jun 6, 2023
1 parent f20d094 commit f67fc96
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 6 deletions.
4 changes: 4 additions & 0 deletions chrome/app/generated_resources.grd
Expand Up @@ -2665,6 +2665,10 @@ are declared in tools/grit/grit_rule.gni.
</message>
<message name="IDS_DOWNLOAD_BUBBLE_STATUS_DEEP_SCANNING_DONE"
desc="When a download has finished deep scanning and the result is safe, let the user know.">
Done, no issues found
</message>
<message name="IDS_DOWNLOAD_BUBBLE_STATUS_DEEP_SCANNING_DONE_UPDATED"
desc="When a download has finished deep scanning and the result is safe, let the user know.">
Scan is done
</message>
<message name="IDS_DOWNLOAD_BUBBLE_STATUS_BLOCKED"
Expand Down
@@ -1 +1 @@
61160924ee2f4cb10869287edbf0f640b874326d
0da76380b25fd33750d5763c6709f60d5af37f9e
@@ -0,0 +1 @@
61160924ee2f4cb10869287edbf0f640b874326d
9 changes: 7 additions & 2 deletions chrome/browser/download/download_item_model_unittest.cc
Expand Up @@ -537,8 +537,13 @@ TEST_F(DownloadItemModelTest, CompletedStatus) {

EXPECT_CALL(item(), GetDangerType())
.WillRepeatedly(Return(download::DOWNLOAD_DANGER_TYPE_DEEP_SCANNED_SAFE));
EXPECT_EQ("2 B \xE2\x80\xA2 Scan is done",
base::UTF16ToUTF8(model().GetStatusText()));
if (base::FeatureList::IsEnabled(safe_browsing::kDeepScanningUpdatedUX)) {
EXPECT_EQ("2 B \xE2\x80\xA2 Scan is done",
base::UTF16ToUTF8(model().GetStatusText()));
} else {
EXPECT_EQ("2 B \xE2\x80\xA2 Done, no issues found",
base::UTF16ToUTF8(model().GetStatusText()));
}

#if BUILDFLAG(IS_MAC)
EXPECT_EQ("Show in Finder", base::UTF16ToUTF8(model().GetShowInFolderText()));
Expand Down
12 changes: 9 additions & 3 deletions chrome/browser/download/download_ui_model.cc
Expand Up @@ -1608,9 +1608,15 @@ DownloadUIModel::BubbleStatusTextBuilder::GetCompletedStatusText() const {
std::u16string delta_str;
if (model_->GetDangerType() ==
download::DOWNLOAD_DANGER_TYPE_DEEP_SCANNED_SAFE) {
// "2 B • Done, no issues found"
delta_str = l10n_util::GetStringUTF16(
IDS_DOWNLOAD_BUBBLE_STATUS_DEEP_SCANNING_DONE);
if (base::FeatureList::IsEnabled(safe_browsing::kDeepScanningUpdatedUX)) {
// "2 B • Scan is done"
delta_str = l10n_util::GetStringUTF16(
IDS_DOWNLOAD_BUBBLE_STATUS_DEEP_SCANNING_DONE_UPDATED);
} else {
// "2 B • Done, no issues found"
delta_str = l10n_util::GetStringUTF16(
IDS_DOWNLOAD_BUBBLE_STATUS_DEEP_SCANNING_DONE);
}
} else {
base::TimeDelta time_elapsed = base::Time::Now() - model_->GetEndTime();
// If less than 1 minute has passed since download completed: "2 B • Done"
Expand Down
4 changes: 4 additions & 0 deletions components/safe_browsing/core/common/features.cc
Expand Up @@ -53,6 +53,10 @@ BASE_FEATURE(kComponentUpdaterAndroidProtegoAllowlist,
"SafeBrowsingComponentUpdaterAndroidProtegoAllowlist",
base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kDeepScanningUpdatedUX,
"SafeBrowsingDeepScanningUpdatedUX",
base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kDelayedWarnings,
"SafeBrowsingDelayedWarnings",
base::FEATURE_DISABLED_BY_DEFAULT);
Expand Down
3 changes: 3 additions & 0 deletions components/safe_browsing/core/common/features.h
Expand Up @@ -49,6 +49,9 @@ BASE_DECLARE_FEATURE(kClientSideDetectionTypeForceRequest);
// Enables serving the Android Protego allowlist through the component updater.
BASE_DECLARE_FEATURE(kComponentUpdaterAndroidProtegoAllowlist);

// Controls whether new deep scanning UX is enabled or not.
BASE_DECLARE_FEATURE(kDeepScanningUpdatedUX);

// Controls whether the delayed warning experiment is enabled.
BASE_DECLARE_FEATURE(kDelayedWarnings);
// True if mouse clicks should undelay the warnings immediately when delayed
Expand Down

0 comments on commit f67fc96

Please sign in to comment.