| Index: chrome/browser/plugins/plugins_field_trial.cc
|
| diff --git a/chrome/browser/plugins/plugins_field_trial.cc b/chrome/browser/plugins/plugins_field_trial.cc
|
| index 68d3d957432c554b800687e63d6a6b089bdb82cd..6e586aa0371f35c1c74ff17779769f57e83935eb 100644
|
| --- a/chrome/browser/plugins/plugins_field_trial.cc
|
| +++ b/chrome/browser/plugins/plugins_field_trial.cc
|
| @@ -5,7 +5,21 @@
|
| #include "chrome/browser/plugins/plugins_field_trial.h"
|
|
|
| #include "base/feature_list.h"
|
| +#include "base/strings/string_number_conversions.h"
|
| #include "chrome/common/chrome_features.h"
|
| +#include "components/variations/variations_associated_data.h"
|
| +
|
| +namespace {
|
| +
|
| +// The default site engagement threshold to allow Flash to be presented as an
|
| +// available plugin.
|
| +const double kSiteEngagementThresholdForFlash = 1.0;
|
| +
|
| +} // namespace
|
| +
|
| +// static
|
| +const char* PluginsFieldTrial::kSiteEngagementThresholdForFlashKey =
|
| + "engagement_threshold_for_flash";
|
|
|
| // static
|
| ContentSetting PluginsFieldTrial::EffectiveContentSetting(
|
| @@ -22,3 +36,14 @@ ContentSetting PluginsFieldTrial::EffectiveContentSetting(
|
| ? ContentSetting::CONTENT_SETTING_DETECT_IMPORTANT_CONTENT
|
| : ContentSetting::CONTENT_SETTING_BLOCK;
|
| }
|
| +
|
| +// static
|
| +double PluginsFieldTrial::GetSiteEngagementThresholdForFlash() {
|
| + double threshold = -1;
|
| + std::string param = variations::GetVariationParamValueByFeature(
|
| + features::kPreferHtmlOverPlugins,
|
| + PluginsFieldTrial::kSiteEngagementThresholdForFlashKey);
|
| + if (base::StringToDouble(param, &threshold) && threshold >= 0)
|
| + return threshold;
|
| + return kSiteEngagementThresholdForFlash;
|
| +}
|
|
|