Skip to content

Commit

Permalink
Merge pull request #5802 from brave/maxk-issue-10160-1.11.x
Browse files Browse the repository at this point in the history
Fixes crash in brave://settings/content/all (1.11.x).
  • Loading branch information
LaurenWags authored Jun 10, 2020
2 parents cd405e0 + 47908ad commit 8e23a06
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
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;

0 comments on commit 8e23a06

Please sign in to comment.