Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes crash in brave://settings/content/all (1.10.x). #5801

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions chromium_src/chrome/browser/ui/webui/site_settings_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#define HasRegisteredGroupName HasRegisteredGroupName_ChromiumImpl
#define ContentSettingsTypeFromGroupName \
ContentSettingsTypeFromGroupName_ChromiumImpl
#define ContentSettingsTypeToGroupName \
ContentSettingsTypeToGroupName_ChromiumImpl
#define BRAVE_SITE_SETTINGS_HELPER_CONTENT_SETTINGS_TYPE_FROM_GROUP_NAME \
if (name == "autoplay") \
return ContentSettingsType::AUTOPLAY;

#include "../../../../../../chrome/browser/ui/webui/site_settings_helper.cc"
#undef BRAVE_SITE_SETTINGS_HELPER_CONTENT_SETTINGS_TYPE_FROM_GROUP_NAME
#undef ContentSettingsTypeToGroupName
#undef ContentSettingsTypeFromGroupName
#undef HasRegisteredGroupName

namespace site_settings {
Expand All @@ -22,12 +23,6 @@ bool HasRegisteredGroupName(ContentSettingsType type) {
return HasRegisteredGroupName_ChromiumImpl(type);
}

ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) {
if (name == "autoplay")
return ContentSettingsType::AUTOPLAY;
return ContentSettingsTypeFromGroupName_ChromiumImpl(name);
}

std::string ContentSettingsTypeToGroupName(ContentSettingsType type) {
if (type == ContentSettingsType::AUTOPLAY)
return "autoplay";
Expand Down
12 changes: 12 additions & 0 deletions patches/chrome-browser-ui-webui-site_settings_helper.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/chrome/browser/ui/webui/site_settings_helper.cc b/chrome/browser/ui/webui/site_settings_helper.cc
index 9de4ee74b87ccd0502f2f77438cfe5fecbb23fec..860835e9b3057276fc99a8e4048598d6e2e2fd49 100644
--- a/chrome/browser/ui/webui/site_settings_helper.cc
+++ b/chrome/browser/ui/webui/site_settings_helper.cc
@@ -371,6 +371,7 @@ bool HasRegisteredGroupName(ContentSettingsType type) {
}

ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) {
+ BRAVE_SITE_SETTINGS_HELPER_CONTENT_SETTINGS_TYPE_FROM_GROUP_NAME
for (size_t i = 0; i < base::size(kContentSettingsTypeGroupNames); ++i) {
if (name == kContentSettingsTypeGroupNames[i].name)
return kContentSettingsTypeGroupNames[i].type;