Commit 89eab0be authored by Carlos IL's avatar Carlos IL Committed by Commit Bot

Launch Recurrent Interstitials

Switched Recurrent Interstitials to enabled by default, in pref mode
for Android and in memory mode for other platforms.

Bug: 840575
Change-Id: Iaa6b6b83312007f81ae28655070004777f7aba87
Reviewed-on: https://chromium-review.googlesource.com/1178991Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
Commit-Queue: Carlos IL <carlosil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583890}
parent 9b36f559
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "base/time/default_clock.h" #include "base/time/default_clock.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h" #include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
...@@ -51,6 +52,16 @@ constexpr char kRecurrentInterstitialModeParam[] = "mode"; ...@@ -51,6 +52,16 @@ constexpr char kRecurrentInterstitialModeParam[] = "mode";
constexpr char kRecurrentInterstitialModeInMemory[] = "in-memory"; constexpr char kRecurrentInterstitialModeInMemory[] = "in-memory";
constexpr char kRecurrentInterstitialModePref[] = "pref"; constexpr char kRecurrentInterstitialModePref[] = "pref";
#if defined(OS_ANDROID)
const base::FeatureParam<std::string> kRecurrentInterstitialMode{
&kRecurrentInterstitialFeature, kRecurrentInterstitialModeParam,
kRecurrentInterstitialModePref};
#else
const base::FeatureParam<std::string> kRecurrentInterstitialMode{
&kRecurrentInterstitialFeature, kRecurrentInterstitialModeParam,
kRecurrentInterstitialModeInMemory};
#endif
// The number of times an error must recur before the recurrent error message is // The number of times an error must recur before the recurrent error message is
// shown. // shown.
constexpr char kRecurrentInterstitialThresholdParam[] = "threshold"; constexpr char kRecurrentInterstitialThresholdParam[] = "threshold";
...@@ -244,7 +255,7 @@ bool HostFilterToPatternFilter( ...@@ -244,7 +255,7 @@ bool HostFilterToPatternFilter(
} // namespace } // namespace
const base::Feature kRecurrentInterstitialFeature{ const base::Feature kRecurrentInterstitialFeature{
"RecurrentInterstitialFeature", base::FEATURE_DISABLED_BY_DEFAULT}; "RecurrentInterstitialFeature", base::FEATURE_ENABLED_BY_DEFAULT};
ChromeSSLHostStateDelegate::ChromeSSLHostStateDelegate(Profile* profile) ChromeSSLHostStateDelegate::ChromeSSLHostStateDelegate(Profile* profile)
: clock_(new base::DefaultClock()), : clock_(new base::DefaultClock()),
...@@ -469,8 +480,7 @@ void ChromeSSLHostStateDelegate::DidDisplayErrorPage(int error) { ...@@ -469,8 +480,7 @@ void ChromeSSLHostStateDelegate::DidDisplayErrorPage(int error) {
return; return;
} }
const std::string mode_param = base::GetFieldTrialParamValueByFeature( const std::string mode_param = kRecurrentInterstitialMode.Get();
kRecurrentInterstitialFeature, kRecurrentInterstitialModeParam);
const int threshold = base::GetFieldTrialParamByFeatureAsInt( const int threshold = base::GetFieldTrialParamByFeatureAsInt(
kRecurrentInterstitialFeature, kRecurrentInterstitialThresholdParam, kRecurrentInterstitialFeature, kRecurrentInterstitialThresholdParam,
kRecurrentInterstitialDefaultThreshold); kRecurrentInterstitialDefaultThreshold);
...@@ -495,8 +505,7 @@ bool ChromeSSLHostStateDelegate::HasSeenRecurrentErrors(int error) const { ...@@ -495,8 +505,7 @@ bool ChromeSSLHostStateDelegate::HasSeenRecurrentErrors(int error) const {
return false; return false;
} }
const std::string mode_param = base::GetFieldTrialParamValueByFeature( const std::string mode_param = kRecurrentInterstitialMode.Get();
kRecurrentInterstitialFeature, kRecurrentInterstitialModeParam);
const int threshold = base::GetFieldTrialParamByFeatureAsInt( const int threshold = base::GetFieldTrialParamByFeatureAsInt(
kRecurrentInterstitialFeature, kRecurrentInterstitialThresholdParam, kRecurrentInterstitialFeature, kRecurrentInterstitialThresholdParam,
kRecurrentInterstitialDefaultThreshold); kRecurrentInterstitialDefaultThreshold);
......
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