From fd0b637eef985040a19bded0b59c2dc244aec04f Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Wed, 25 Nov 2020 21:27:07 +0100 Subject: [PATCH] fix autoplay setting --- ...moval-of-an-option-to-block-autoplay.patch | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch b/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch index 5c77b4ab..3b5d3b4e 100644 --- a/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch +++ b/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch @@ -10,15 +10,15 @@ Subject: Revert the removal of an option to block autoplay .../res/drawable-xxhdpi/settings_autoplay.png | Bin 0 -> 792 bytes .../drawable-xxxhdpi/settings_autoplay.png | Bin 0 -> 1064 bytes .../res/xml/single_website_preferences.xml | 2 ++ - .../res/xml/site_settings_preferences.xml | 4 ++++ + .../res/xml/site_settings_preferences.xml | 4 +++ .../ContentSettingsResources.java | 5 ++++ - .../site_settings/SingleCategorySettings.java | 4 ++++ - .../site_settings/SingleWebsiteSettings.java | 22 ++++++++++++++++++ + .../site_settings/SingleCategorySettings.java | 4 +++ + .../site_settings/SingleWebsiteSettings.java | 22 +++++++++++++++++ .../site_settings/SiteSettingsCategory.java | 9 +++++-- - .../browser_ui/site_settings/Website.java | 8 +++++++ + .../browser_ui/site_settings/Website.java | 8 ++++++ .../WebsitePermissionsFetcher.java | 1 + .../WebsitePreferenceBridge.java | 14 +++++++++++ - .../android/website_preference_bridge.cc | 22 ++++++++++++++++++ + .../android/website_preference_bridge.cc | 23 ++++++++++++++++++ .../strings/android/site_settings.grdp | 9 +++++++ .../core/browser/content_settings_registry.cc | 2 +- .../core/browser/content_settings_utils.cc | 2 ++ @@ -34,9 +34,9 @@ Subject: Revert the removal of an option to block autoplay components/page_info/page_info_ui.cc | 1 + components/page_info_strings.grdp | 3 +++ .../platform/web_content_settings_client.h | 3 +++ - .../core/html/media/autoplay_policy.cc | 12 +++++++++- - .../core/html/media/autoplay_policy.h | 4 ++++ - 33 files changed, 156 insertions(+), 4 deletions(-) + .../core/html/media/autoplay_policy.cc | 12 ++++++++- + .../core/html/media/autoplay_policy.h | 4 +++ + 33 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_autoplay.png create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png @@ -430,6 +430,14 @@ diff --git a/components/browser_ui/site_settings/android/website_preference_brid static jboolean JNI_WebsitePreferenceBridge_IsContentSettingsPatternValid( JNIEnv* env, const JavaParamRef& pattern) { +@@ -1113,6 +1135,7 @@ static void JNI_WebsitePreferenceBridge_SetContentSettingEnabled( + case ContentSettingsType::POPUPS: + case ContentSettingsType::SENSORS: + case ContentSettingsType::SOUND: ++ case ContentSettingsType::AUTOPLAY: + value = CONTENT_SETTING_ALLOW; + break; + default: diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp --- a/components/browser_ui/strings/android/site_settings.grdp +++ b/components/browser_ui/strings/android/site_settings.grdp @@ -516,7 +524,7 @@ diff --git a/components/content_settings/core/common/content_settings_mojom_trai + data.ReadAutoplayRules(&out->autoplay_rules) && data.ReadPopupRedirectRules(&out->popup_redirect_rules) && data.ReadMixedContentRules(&out->mixed_content_rules) && - data.ReadTimezoneOverrideRules(&out->timezone_override_rules) && + data.ReadTimezoneOverrideRules(&out->timezone_override_rules) && diff --git a/components/content_settings/core/common/content_settings_mojom_traits.h b/components/content_settings/core/common/content_settings_mojom_traits.h --- a/components/content_settings/core/common/content_settings_mojom_traits.h +++ b/components/content_settings/core/common/content_settings_mojom_traits.h