Commit 6374c9b2 authored by Balazs Engedy's avatar Balazs Engedy Committed by Commit Bot

Remove chrome://flags/#enable-ephemeral-flash-permission.

Bug: 892156
Change-Id: I2daa27782f4765d7f770505b0a198b5632678cc6
Reviewed-on: https://chromium-review.googlesource.com/c/1264660
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599317}
parent 9d5b70e1
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#include "components/browser_sync/browser_sync_switches.h" #include "components/browser_sync/browser_sync_switches.h"
#include "components/browsing_data/core/features.h" #include "components/browsing_data/core/features.h"
#include "components/cloud_devices/common/cloud_devices_switches.h" #include "components/cloud_devices/common/cloud_devices_switches.h"
#include "components/content_settings/core/common/features.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h"
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
#include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/dom_distiller/core/dom_distiller_switches.h"
...@@ -4191,12 +4190,6 @@ const FeatureEntry kFeatureEntries[] = { ...@@ -4191,12 +4190,6 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnableCSSFragmentIdentifiersDescription, kOsAll, flag_descriptions::kEnableCSSFragmentIdentifiersDescription, kOsAll,
FEATURE_VALUE_TYPE(features::kCSSFragmentIdentifiers)}, FEATURE_VALUE_TYPE(features::kCSSFragmentIdentifiers)},
{"enable-ephemeral-flash-permission",
flag_descriptions::kEnableEphemeralFlashPermissionName,
flag_descriptions::kEnableEphemeralFlashPermissionDescription, kOsDesktop,
FEATURE_VALUE_TYPE(
content_settings::features::kEnableEphemeralFlashPermission)},
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
{"infinite-session-restore", flag_descriptions::kInfiniteSessionRestoreName, {"infinite-session-restore", flag_descriptions::kInfiniteSessionRestoreName,
flag_descriptions::kInfiniteSessionRestoreDescription, kOsDesktop, flag_descriptions::kInfiniteSessionRestoreDescription, kOsDesktop,
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "components/content_settings/core/browser/user_modifiable_provider.h" #include "components/content_settings/core/browser/user_modifiable_provider.h"
#include "components/content_settings/core/browser/website_settings_info.h" #include "components/content_settings/core/browser/website_settings_info.h"
#include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/browser/website_settings_registry.h"
#include "components/content_settings/core/common/features.h"
#include "components/content_settings/core/common/pref_names.h" #include "components/content_settings/core/common/pref_names.h"
#include "components/content_settings/core/test/content_settings_test_utils.h" #include "components/content_settings/core/test/content_settings_test_utils.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
...@@ -1948,11 +1947,10 @@ void ReloadProviders(PrefService* pref_service, ...@@ -1948,11 +1947,10 @@ void ReloadProviders(PrefService* pref_service,
HostContentSettingsMap::EPHEMERAL_PROVIDER); HostContentSettingsMap::EPHEMERAL_PROVIDER);
} }
// Tests if availability of EnableEphemeralFlashPermission switch results in // Tests that Flash permissions are reset after restarting.
// Flash permissions being reset after restarting. // Flash, and consequently, Flash permissions are not available on Android.
// The flag is not available on Android.
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
TEST_F(HostContentSettingsMapTest, FlashEphemeralPermissionSwitch) { TEST_F(HostContentSettingsMapTest, FlashPermissionsAreEphemeral) {
TestingProfile profile; TestingProfile profile;
HostContentSettingsMap* map = HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(&profile); HostContentSettingsMapFactory::GetForProfile(&profile);
...@@ -1961,47 +1959,31 @@ TEST_F(HostContentSettingsMapTest, FlashEphemeralPermissionSwitch) { ...@@ -1961,47 +1959,31 @@ TEST_F(HostContentSettingsMapTest, FlashEphemeralPermissionSwitch) {
map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, map->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
CONTENT_SETTING_ASK); CONTENT_SETTING_ASK);
for (int ephemeral = 0; ephemeral < 2; ephemeral++) { base::test::ScopedFeatureList feature_list;
base::test::ScopedFeatureList feature_list; content_settings::ContentSettingsRegistry::GetInstance()->ResetForTest();
if (ephemeral) {
feature_list.InitAndEnableFeature( ReloadProviders(profile.GetPrefs(), map);
content_settings::features::kEnableEphemeralFlashPermission); map->SetContentSettingDefaultScope(url, url, CONTENT_SETTINGS_TYPE_PLUGINS,
} else { std::string(), CONTENT_SETTING_ALLOW);
feature_list.InitAndDisableFeature( EXPECT_EQ(CONTENT_SETTING_ALLOW,
content_settings::features::kEnableEphemeralFlashPermission); map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_PLUGINS,
} std::string()));
content_settings::ContentSettingsRegistry::GetInstance()->ResetForTest();
ReloadProviders(profile.GetPrefs(), map);
ReloadProviders(profile.GetPrefs(), map); EXPECT_EQ(CONTENT_SETTING_ASK,
map->SetContentSettingDefaultScope(url, url, CONTENT_SETTINGS_TYPE_PLUGINS, map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_PLUGINS,
std::string(), CONTENT_SETTING_ALLOW); std::string()));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_PLUGINS,
std::string()));
ReloadProviders(profile.GetPrefs(), map);
ContentSetting expectation =
ephemeral ? CONTENT_SETTING_ASK : CONTENT_SETTING_ALLOW;
EXPECT_EQ(expectation,
map->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_PLUGINS,
std::string()))
<< ephemeral;
}
} }
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
// Tests if restarting only removes ephemeral permissions. // Tests that restarting only removes ephemeral permissions. Flash, and
// kEnableEphemeralFlashPermission is not available on Android. // consequently, Flash permissions are not available on Android.
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
TEST_F(HostContentSettingsMapTest, MixedEphemeralAndPersistentPermissions) { TEST_F(HostContentSettingsMapTest, MixedEphemeralAndPersistentPermissions) {
TestingProfile profile; TestingProfile profile;
HostContentSettingsMap* map = HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(&profile); HostContentSettingsMapFactory::GetForProfile(&profile);
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(
content_settings::features::kEnableEphemeralFlashPermission);
content_settings::ContentSettingsRegistry::GetInstance()->ResetForTest(); content_settings::ContentSettingsRegistry::GetInstance()->ResetForTest();
ReloadProviders(profile.GetPrefs(), map); ReloadProviders(profile.GetPrefs(), map);
...@@ -2052,18 +2034,15 @@ TEST_F(HostContentSettingsMapTest, MixedEphemeralAndPersistentPermissions) { ...@@ -2052,18 +2034,15 @@ TEST_F(HostContentSettingsMapTest, MixedEphemeralAndPersistentPermissions) {
} }
#endif // !defined(OS_ANDROID) #endif // !defined(OS_ANDROID)
// Tests if directly writing a value to PrefProvider doesn't affect ephmeral // Test that directly writing a value to PrefProvider doesn't affect ephmeral
// types. // types. Flash, and consequently, Flash permissions are not available on
// kEnableEphemeralFlashPermission is not available on Android. // Android.
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
TEST_F(HostContentSettingsMapTest, EphemeralTypeDoesntReadFromPrefProvider) { TEST_F(HostContentSettingsMapTest, EphemeralTypeDoesntReadFromPrefProvider) {
TestingProfile profile; TestingProfile profile;
HostContentSettingsMap* map = HostContentSettingsMap* map =
HostContentSettingsMapFactory::GetForProfile(&profile); HostContentSettingsMapFactory::GetForProfile(&profile);
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(
content_settings::features::kEnableEphemeralFlashPermission);
content_settings::ContentSettingsRegistry::GetInstance()->ResetForTest(); content_settings::ContentSettingsRegistry::GetInstance()->ResetForTest();
ReloadProviders(profile.GetPrefs(), map); ReloadProviders(profile.GetPrefs(), map);
......
...@@ -479,12 +479,6 @@ const char kEnableCursorMotionBlurName[] = "Enable Cursor Motion Blur"; ...@@ -479,12 +479,6 @@ const char kEnableCursorMotionBlurName[] = "Enable Cursor Motion Blur";
const char kEnableCursorMotionBlurDescription[] = const char kEnableCursorMotionBlurDescription[] =
"Enable motion blur effect for the cursor."; "Enable motion blur effect for the cursor.";
const char kEnableEphemeralFlashPermissionName[] =
"Enable Ephemeral Flash Permissions";
const char kEnableEphemeralFlashPermissionDescription[] =
"When enabled, Flash plugin permissions are reset at the end of the "
"browser session.";
const char kEnableNoScriptPreviewsName[] = "NoScript previews"; const char kEnableNoScriptPreviewsName[] = "NoScript previews";
const char kEnableNoScriptPreviewsDescription[] = const char kEnableNoScriptPreviewsDescription[] =
......
...@@ -319,9 +319,6 @@ extern const char kEnableCSSFragmentIdentifiersDescription[]; ...@@ -319,9 +319,6 @@ extern const char kEnableCSSFragmentIdentifiersDescription[];
extern const char kEnableCursorMotionBlurName[]; extern const char kEnableCursorMotionBlurName[];
extern const char kEnableCursorMotionBlurDescription[]; extern const char kEnableCursorMotionBlurDescription[];
extern const char kEnableEphemeralFlashPermissionName[];
extern const char kEnableEphemeralFlashPermissionDescription[];
extern const char kEnableNoScriptPreviewsName[]; extern const char kEnableNoScriptPreviewsName[];
extern const char kEnableNoScriptPreviewsDescription[]; extern const char kEnableNoScriptPreviewsDescription[];
......
...@@ -410,12 +410,10 @@ ...@@ -410,12 +410,10 @@
</template> </template>
<template is="dom-if" route-path="/content/flash" no-search> <template is="dom-if" route-path="/content/flash" no-search>
<settings-subpage page-title="$i18n{siteSettingsFlash}"> <settings-subpage page-title="$i18n{siteSettingsFlash}">
<template is="dom-if" if="[[enableEphemeralFlashPermission_]]"> <a class="settings-box first" tabindex="-1"
<a class="settings-box first" tabindex="-1" target="_blank">
target="_blank"> $i18n{siteSettingsFlashPermissionsEphemeral}
$i18n{siteSettingsFlashPermissionsEphemeral} </a>
</a>
</template>
<category-default-setting category="{{ContentSettingsTypes.PLUGINS}}" <category-default-setting category="{{ContentSettingsTypes.PLUGINS}}"
toggle-off-label="$i18n{siteSettingsFlashBlock}" toggle-off-label="$i18n{siteSettingsFlashBlock}"
toggle-on-label="$i18n{siteSettingsFlashAskFirstRecommended}"> toggle-on-label="$i18n{siteSettingsFlashAskFirstRecommended}">
...@@ -432,8 +430,7 @@ ...@@ -432,8 +430,7 @@
</if> </if>
<category-setting-exceptions <category-setting-exceptions
category="{{ContentSettingsTypes.PLUGINS}}" category="{{ContentSettingsTypes.PLUGINS}}"
block-header="$i18n{siteSettingsBlock}" block-header="$i18n{siteSettingsBlock}" read-only-list>
read-only-list="[[enableEphemeralFlashPermission_]]">
</category-setting-exceptions> </category-setting-exceptions>
</settings-subpage> </settings-subpage>
</template> </template>
......
...@@ -162,14 +162,6 @@ Polymer({ ...@@ -162,14 +162,6 @@ Polymer({
}, },
}, },
/** @private */
enableEphemeralFlashPermission_: {
type: Boolean,
value: function() {
return loadTimeData.getBoolean('enableEphemeralFlashPermission');
},
},
// <if expr="not chromeos"> // <if expr="not chromeos">
/** @private */ /** @private */
showRestart_: Boolean, showRestart_: Boolean,
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
#include "components/autofill/core/common/autofill_constants.h" #include "components/autofill/core/common/autofill_constants.h"
#include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_features.h"
#include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service.h"
#include "components/content_settings/core/common/features.h"
#include "components/google/core/common/google_util.h" #include "components/google/core/common/google_util.h"
#include "components/omnibox/browser/omnibox_field_trial.h" #include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_features.h"
...@@ -2607,11 +2606,6 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source, ...@@ -2607,11 +2606,6 @@ void AddSiteSettingsStrings(content::WebUIDataSource* html_source,
"enablePaymentHandlerContentSetting", "enablePaymentHandlerContentSetting",
base::FeatureList::IsEnabled(features::kServiceWorkerPaymentApps)); base::FeatureList::IsEnabled(features::kServiceWorkerPaymentApps));
html_source->AddBoolean(
"enableEphemeralFlashPermission",
base::FeatureList::IsEnabled(
content_settings::features::kEnableEphemeralFlashPermission));
if (PluginUtils::ShouldPreferHtmlOverPlugins( if (PluginUtils::ShouldPreferHtmlOverPlugins(
HostContentSettingsMapFactory::GetForProfile(profile))) { HostContentSettingsMapFactory::GetForProfile(profile))) {
LocalizedString flash_strings[] = { LocalizedString flash_strings[] = {
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/browser/content_settings_utils.h"
#include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/browser/website_settings_registry.h"
#include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/features.h"
namespace content_settings { namespace content_settings {
...@@ -150,19 +149,17 @@ void ContentSettingsRegistry::Init() { ...@@ -150,19 +149,17 @@ void ContentSettingsRegistry::Init() {
ContentSettingsInfo::INHERIT_IN_INCOGNITO, ContentSettingsInfo::INHERIT_IN_INCOGNITO,
ContentSettingsInfo::PERSISTENT); ContentSettingsInfo::PERSISTENT);
Register( Register(CONTENT_SETTINGS_TYPE_PLUGINS, "plugins",
CONTENT_SETTINGS_TYPE_PLUGINS, "plugins", CONTENT_SETTING_DETECT_IMPORTANT_CONTENT,
CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, WebsiteSettingsInfo::SYNCABLE, WebsiteSettingsInfo::SYNCABLE,
WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme), WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme),
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK,
CONTENT_SETTING_ASK, CONTENT_SETTING_ASK,
CONTENT_SETTING_DETECT_IMPORTANT_CONTENT), CONTENT_SETTING_DETECT_IMPORTANT_CONTENT),
WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE, WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE,
WebsiteSettingsRegistry::DESKTOP, WebsiteSettingsRegistry::DESKTOP,
ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE, ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE,
base::FeatureList::IsEnabled(features::kEnableEphemeralFlashPermission) ContentSettingsInfo::EPHEMERAL);
? ContentSettingsInfo::EPHEMERAL
: ContentSettingsInfo::PERSISTENT);
Register(CONTENT_SETTINGS_TYPE_POPUPS, "popups", CONTENT_SETTING_BLOCK, Register(CONTENT_SETTINGS_TYPE_POPUPS, "popups", CONTENT_SETTING_BLOCK,
WebsiteSettingsInfo::SYNCABLE, WebsiteSettingsInfo::SYNCABLE,
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "components/content_settings/core/browser/website_settings_registry.h" #include "components/content_settings/core/browser/website_settings_registry.h"
#include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_utils.h" #include "components/content_settings/core/common/content_settings_utils.h"
#include "components/content_settings/core/common/features.h"
#include "components/content_settings/core/common/pref_names.h" #include "components/content_settings/core/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
...@@ -533,9 +532,7 @@ void HostContentSettingsMap::SetContentSettingCustomScope( ...@@ -533,9 +532,7 @@ void HostContentSettingsMap::SetContentSettingCustomScope(
// Record stats on Flash permission grants with ephemeral storage. // Record stats on Flash permission grants with ephemeral storage.
if (content_type == CONTENT_SETTINGS_TYPE_PLUGINS && if (content_type == CONTENT_SETTINGS_TYPE_PLUGINS &&
setting == CONTENT_SETTING_ALLOW && setting == CONTENT_SETTING_ALLOW) {
base::FeatureList::IsEnabled(
content_settings::features::kEnableEphemeralFlashPermission)) {
GURL url(primary_pattern.ToString()); GURL url(primary_pattern.ToString());
ContentSettingsPattern temp_patterns[2]; ContentSettingsPattern temp_patterns[2];
std::unique_ptr<base::Value> value(GetContentSettingValueAndPatterns( std::unique_ptr<base::Value> value(GetContentSettingValueAndPatterns(
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/features.h"
namespace { namespace {
...@@ -181,17 +180,13 @@ void WebsiteSettingsRegistry::Init() { ...@@ -181,17 +180,13 @@ void WebsiteSettingsRegistry::Init() {
WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE, WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE,
DESKTOP | PLATFORM_ANDROID, DESKTOP | PLATFORM_ANDROID,
WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO); WebsiteSettingsInfo::DONT_INHERIT_IN_INCOGNITO);
Register( // To counteract the reduced usability of the Flash permission when it becomes
CONTENT_SETTINGS_TYPE_PLUGINS_DATA, "flash-data", nullptr, // ephemeral, we sync the bit indicating that the Flash permission should be
// To counteract the reduced usability of the Flash permission // displayed in the page info.
// when it becomes ephemeral, we sync the bit indicating that Register(CONTENT_SETTINGS_TYPE_PLUGINS_DATA, "flash-data", nullptr,
// the Flash permission should be displayed in the page info. WebsiteSettingsInfo::SYNCABLE, WebsiteSettingsInfo::NOT_LOSSY,
base::FeatureList::IsEnabled(features::kEnableEphemeralFlashPermission) WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE,
? WebsiteSettingsInfo::SYNCABLE DESKTOP, WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);
: WebsiteSettingsInfo::UNSYNCABLE,
WebsiteSettingsInfo::NOT_LOSSY,
WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE,
DESKTOP, WebsiteSettingsInfo::INHERIT_IN_INCOGNITO);
} }
} // namespace content_settings } // namespace content_settings
...@@ -18,8 +18,6 @@ jumbo_static_library("common") { ...@@ -18,8 +18,6 @@ jumbo_static_library("common") {
"content_settings_utils.h", "content_settings_utils.h",
"cookie_settings_base.cc", "cookie_settings_base.cc",
"cookie_settings_base.h", "cookie_settings_base.h",
"features.cc",
"features.h",
"pref_names.cc", "pref_names.cc",
"pref_names.h", "pref_names.h",
] ]
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file defines all the public base::FeatureList features for the chrome
// module.
#include "components/content_settings/core/common/features.h"
namespace content_settings {
namespace features {
// Makes Flash plugin permissions persistent only through the current session.
const base::Feature kEnableEphemeralFlashPermission{
"EnableEphemeralFlashPermission", base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features
} // namespace content_settings
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file defines all the public base::FeatureList features for the chrome
// module.
#ifndef COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_FEATURES_H_
#define COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_FEATURES_H_
#include "base/feature_list.h"
namespace content_settings {
namespace features {
extern const base::Feature kEnableEphemeralFlashPermission;
} // namespace features
} // namespace content_settings
#endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_FEATURES_H_
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