Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: chrome/browser/banners/app_banner_manager.cc

Issue 2833313002: Fix the ability to bypass app banner engagement checks. (Closed)
Patch Set: Address comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/banners/app_banner_manager.cc
diff --git a/chrome/browser/banners/app_banner_manager.cc b/chrome/browser/banners/app_banner_manager.cc
index af60409cd692e10b1b0c721d1e6a42ce6f4d73e4..e60ba716805b8869fd27acbebb27404ddd5db21c 100644
--- a/chrome/browser/banners/app_banner_manager.cc
+++ b/chrome/browser/banners/app_banner_manager.cc
@@ -391,12 +391,16 @@ void AppBannerManager::DidFinishLoad(
load_finished_ = true;
validated_url_ = validated_url;
- // Start the pipeline immediately if:
- // 1. we have sufficient engagement, or
- // 2. 0 engagement is required, or
- // 3. the feature to start the installability check in load is enabled
+
+ // If the bypass flag is on, or if we require no engagement to trigger the
+ // banner, the rest of the banner pipeline should operate as if the engagement
+ // threshold has been met.
+ if (AppBannerSettingsHelper::HasSufficientEngagement(0))
+ has_sufficient_engagement_ = true;
+
+ // Start the pipeline immediately if we pass (or bypass) the engagement check,
+ // or if the feature to run the installability check on page load is enabled.
if (has_sufficient_engagement_ ||
- AppBannerSettingsHelper::HasSufficientEngagement(0) ||
base::FeatureList::IsEnabled(
features::kCheckInstallabilityForBannerOnLoad)) {
RequestAppBanner(validated_url, false /* is_debug_mode */);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698