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

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

Issue 1011963003: Modify behavior of --bypass-app-banner-engagement-checks flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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_settings_helper.cc
diff --git a/chrome/browser/banners/app_banner_settings_helper.cc b/chrome/browser/banners/app_banner_settings_helper.cc
index 33c42ef08a21e70945aa20bc67542f2ddb456dab..2506f3e2aef4c58f9e29e68cbca418f6d225bcb9 100644
--- a/chrome/browser/banners/app_banner_settings_helper.cc
+++ b/chrome/browser/banners/app_banner_settings_helper.cc
@@ -180,11 +180,6 @@ bool AppBannerSettingsHelper::ShouldShowBanner(
const GURL& origin_url,
const std::string& package_name_or_start_url,
base::Time time) {
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kBypassAppBannerEngagementChecks)) {
- return true;
- }
-
// Don't show if it has been added to the homescreen.
base::Time added_time =
GetSingleBannerEvent(web_contents, origin_url, package_name_or_start_url,
@@ -194,6 +189,12 @@ bool AppBannerSettingsHelper::ShouldShowBanner(
return false;
}
+ // Otherwise, ignore all checks if the flag to do so is set.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kBypassAppBannerEngagementChecks)) {
+ return true;
+ }
+
base::Time blocked_time =
GetSingleBannerEvent(web_contents, origin_url, package_name_or_start_url,
APP_BANNER_EVENT_DID_BLOCK);
« 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