Commit 28d5c19d authored by Andy Paicu's avatar Andy Paicu Committed by Commit Bot

Reland: Reversed crowd deny preload list logic

The crowd deny preload list now contains sites with a site reputation
of UNSOLICITED_PROMPTS. If a site is not on the preload list the normal
UI is used, otherwise a safe browsing ping is made to ensure that the
preload list is accurate.

Unit tests and test-fixes in a follow-up CL: For the purposes of speed
I have removed the failing test, will be re-added in the follow-up CL
along with new tests to account for this logic change.

Reland that fixes a bug in previous CL. First CL is previous CL.

TBR=engedy@chromium.org

Bug: 1042611
Change-Id: Ic70a991860d1945d0432330ca866b139371ec0d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003320
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Auto-Submit: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarAndy Paicu <andypaicu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732381}
parent ebc5f3a9
......@@ -136,11 +136,12 @@ void ContextualNotificationPermissionUiSelector::EvaluateCrowdDenyTrigger(
base::Optional<UiToUse> ui_to_use = GetUiToUseBasedOnSiteReputation(
CrowdDenyPreloadData::GetInstance()->GetReputationDataForSite(origin));
if (ui_to_use) {
OnCrowdDenyTriggerEvaluated(*ui_to_use);
if (!ui_to_use || *ui_to_use == UiToUse::kNormalUi) {
OnCrowdDenyTriggerEvaluated(UiToUse::kNormalUi);
return;
}
// PreloadData suggests a spammy site, ping safe browsing to verify.
DCHECK(!safe_browsing_request_);
DCHECK(g_browser_process->safe_browsing_service());
......
......@@ -969,7 +969,8 @@ TEST_F(PermissionRequestManagerTest, TestWebKioskModeDifferentOrigin) {
}
#endif // defined(OS_CHROMEOS)
TEST_F(PermissionRequestManagerTest, TestCrowdDenyHoldbackChance) {
// TODO(andypaicu): re-enable ASAP. crbug.com/1042611
TEST_F(PermissionRequestManagerTest, DISABLED_TestCrowdDenyHoldbackChance) {
const struct {
std::string holdback_chance;
bool enabled_in_prefs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment