-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use BraveInit() to unregister and register the default registry value
- Loading branch information
Showing
4 changed files
with
51 additions
and
11 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
chromium_src/components/content_settings/core/browser/content_settings_registry.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include "../../../../../../components/content_settings/core/browser/content_settings_registry.cc" | ||
|
||
namespace content_settings { | ||
|
||
void ContentSettingsRegistry::BraveInit() { | ||
// Add CONTENT_SETTING_ASK and make it default for autoplay | ||
content_settings_info_.erase(CONTENT_SETTINGS_TYPE_AUTOPLAY); | ||
website_settings_registry_->UnRegister(CONTENT_SETTINGS_TYPE_AUTOPLAY); | ||
Register(CONTENT_SETTINGS_TYPE_AUTOPLAY, "autoplay", CONTENT_SETTING_ASK, | ||
WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(), | ||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, | ||
CONTENT_SETTING_ASK), | ||
WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, | ||
WebsiteSettingsRegistry::DESKTOP | | ||
WebsiteSettingsRegistry::PLATFORM_ANDROID, | ||
ContentSettingsInfo::INHERIT_IN_INCOGNITO); | ||
|
||
} | ||
|
||
} |
18 changes: 7 additions & 11 deletions
18
patches/components-content_settings-core-browser-content_settings_registry.cc.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc | ||
index 6a0478a2e2dad6a715aaedf35a52d09612340881..2b4e6649c53cf74c4f0d9652f30306460e4a916c 100644 | ||
index 6a0478a2e2dad6a715aaedf35a52d09612340881..de60070c9bdb424497d51d51f7db0bed85e15ffa 100644 | ||
--- a/components/content_settings/core/browser/content_settings_registry.cc | ||
+++ b/components/content_settings/core/browser/content_settings_registry.cc | ||
@@ -265,9 +265,9 @@ void ContentSettingsRegistry::Init() { | ||
WebsiteSettingsRegistry::PLATFORM_ANDROID, | ||
ContentSettingsInfo::INHERIT_IN_INCOGNITO); | ||
|
||
- Register(CONTENT_SETTINGS_TYPE_AUTOPLAY, "autoplay", CONTENT_SETTING_ALLOW, | ||
+ Register(CONTENT_SETTINGS_TYPE_AUTOPLAY, "autoplay", CONTENT_SETTING_ASK, | ||
WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(), | ||
- ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK), | ||
+ ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, CONTENT_SETTING_ASK), | ||
WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE, | ||
@@ -361,6 +361,7 @@ void ContentSettingsRegistry::Init() { | ||
WebsiteSettingsRegistry::DESKTOP | | ||
WebsiteSettingsRegistry::PLATFORM_ANDROID, | ||
ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); | ||
+ BraveInit(); | ||
} | ||
|
||
void ContentSettingsRegistry::Register( |
12 changes: 12 additions & 0 deletions
12
patches/components-content_settings-core-browser-content_settings_registry.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/components/content_settings/core/browser/content_settings_registry.h b/components/content_settings/core/browser/content_settings_registry.h | ||
index 14675088fd820177584f64ebf70bfed84009ccbe..95fee3d64377763af1fdd412583e8fe3b3c77a09 100644 | ||
--- a/components/content_settings/core/browser/content_settings_registry.h | ||
+++ b/components/content_settings/core/browser/content_settings_registry.h | ||
@@ -53,6 +53,7 @@ class ContentSettingsRegistry { | ||
~ContentSettingsRegistry(); | ||
|
||
void Init(); | ||
+ void BraveInit(); | ||
|
||
typedef uint32_t Platforms; | ||
|
12 changes: 12 additions & 0 deletions
12
patches/components-content_settings-core-browser-website_settings_registry.h.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/components/content_settings/core/browser/website_settings_registry.h b/components/content_settings/core/browser/website_settings_registry.h | ||
index f717f0c6ad479bfcc533f441f6e377963943525c..645a9cf52c2b1360b716e06da4e79b334ba8a8f4 100644 | ||
--- a/components/content_settings/core/browser/website_settings_registry.h | ||
+++ b/components/content_settings/core/browser/website_settings_registry.h | ||
@@ -75,6 +75,7 @@ class WebsiteSettingsRegistry { | ||
WebsiteSettingsInfo::ScopingType scoping_type, | ||
Platforms platforms, | ||
WebsiteSettingsInfo::IncognitoBehavior incognito_behavior); | ||
+ void UnRegister(ContentSettingsType type) {website_settings_info_.erase(type);} | ||
|
||
const_iterator begin() const; | ||
const_iterator end() const; |