-
Notifications
You must be signed in to change notification settings - Fork 888
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert method to macro to avoid patching the
.h
file
- Loading branch information
Showing
3 changed files
with
40 additions
and
49 deletions.
There are no files selected for viewing
73 changes: 38 additions & 35 deletions
73
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 |
---|---|---|
@@ -1,38 +1,41 @@ | ||
#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_BLOCK, | ||
WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(), | ||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, | ||
CONTENT_SETTING_ASK), | ||
WebsiteSettingsInfo::SINGLE_ORIGIN_ONLY_SCOPE, | ||
WebsiteSettingsRegistry::DESKTOP | | ||
WebsiteSettingsRegistry::PLATFORM_ANDROID, | ||
ContentSettingsInfo::INHERIT_IN_INCOGNITO, | ||
ContentSettingsInfo::PERSISTENT, | ||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS); | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
* You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
// Change plugins default to CONTENT_SETTING_BLOCK | ||
content_settings_info_.erase(CONTENT_SETTINGS_TYPE_PLUGINS); | ||
website_settings_registry_->UnRegister(CONTENT_SETTINGS_TYPE_PLUGINS); | ||
Register( | ||
CONTENT_SETTINGS_TYPE_PLUGINS, "plugins", | ||
CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::SYNCABLE, | ||
WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme), | ||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, | ||
CONTENT_SETTING_ASK, | ||
CONTENT_SETTING_DETECT_IMPORTANT_CONTENT), | ||
WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE, | ||
WebsiteSettingsRegistry::DESKTOP | | ||
WebsiteSettingsRegistry::PLATFORM_ANDROID, | ||
ContentSettingsInfo::INHERIT_IN_INCOGNITO, | ||
ContentSettingsInfo::EPHEMERAL, | ||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS); | ||
#define BRAVE_INIT { \ | ||
/* 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_BLOCK, \ | ||
WebsiteSettingsInfo::UNSYNCABLE, WhitelistedSchemes(), \ | ||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, \ | ||
CONTENT_SETTING_ASK), \ | ||
WebsiteSettingsInfo::SINGLE_ORIGIN_ONLY_SCOPE, \ | ||
WebsiteSettingsRegistry::DESKTOP | \ | ||
WebsiteSettingsRegistry::PLATFORM_ANDROID, \ | ||
ContentSettingsInfo::INHERIT_IN_INCOGNITO, \ | ||
ContentSettingsInfo::PERSISTENT, \ | ||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS); \ | ||
\ | ||
/* Change plugins default to CONTENT_SETTING_BLOCK*/ \ | ||
content_settings_info_.erase(CONTENT_SETTINGS_TYPE_PLUGINS); \ | ||
website_settings_registry_->UnRegister(CONTENT_SETTINGS_TYPE_PLUGINS); \ | ||
Register( \ | ||
CONTENT_SETTINGS_TYPE_PLUGINS, "plugins", \ | ||
CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::SYNCABLE, \ | ||
WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme), \ | ||
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, \ | ||
CONTENT_SETTING_ASK, \ | ||
CONTENT_SETTING_DETECT_IMPORTANT_CONTENT), \ | ||
WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE, \ | ||
WebsiteSettingsRegistry::DESKTOP | \ | ||
WebsiteSettingsRegistry::PLATFORM_ANDROID, \ | ||
ContentSettingsInfo::INHERIT_IN_INCOGNITO, \ | ||
ContentSettingsInfo::EPHEMERAL, \ | ||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS); \ | ||
} | ||
|
||
} // namespace content_settings | ||
#include "../../../../../../components/content_settings/core/browser/content_settings_registry.cc" | ||
|
||
#undef BRAVE_INIT |
4 changes: 2 additions & 2 deletions
4
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,12 +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 dc67564cd90fb1964de545b933ac5104dbfbc785..d9ca4251e5e9606566dcd88ba5f76f1dca0759cd 100644 | ||
index dc67564cd90fb1964de545b933ac5104dbfbc785..95ce90bc2960359d65433038b225c6f3cf53d996 100644 | ||
--- a/components/content_settings/core/browser/content_settings_registry.cc | ||
+++ b/components/content_settings/core/browser/content_settings_registry.cc | ||
@@ -491,6 +491,7 @@ void ContentSettingsRegistry::Init() { | ||
ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE, | ||
ContentSettingsInfo::PERSISTENT, | ||
ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); | ||
+ BraveInit(); | ||
+ BRAVE_INIT | ||
} | ||
|
||
void ContentSettingsRegistry::Register( |
12 changes: 0 additions & 12 deletions
12
patches/components-content_settings-core-browser-content_settings_registry.h.patch
This file was deleted.
Oops, something went wrong.