Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(692)

Unified Diff: chrome/browser/ui/webui/site_settings_helper.cc

Issue 2048633002: Site Settings Desktop: Fix NOTREACHED when group name is unregistered. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/site_settings_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/site_settings_helper.cc
diff --git a/chrome/browser/ui/webui/site_settings_helper.cc b/chrome/browser/ui/webui/site_settings_helper.cc
index 5c8ef31845f589a35a61850b400e537a70d3d832..37373cb65116aa1f35d48fcfa8163560f6657aa2 100644
--- a/chrome/browser/ui/webui/site_settings_helper.cc
+++ b/chrome/browser/ui/webui/site_settings_helper.cc
@@ -51,6 +51,14 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = {
{CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, "background-sync"},
};
+bool HasRegisteredGroupName(ContentSettingsType type) {
+ for (size_t i = 0; i < arraysize(kContentSettingsTypeGroupNames); ++i) {
+ if (type == kContentSettingsTypeGroupNames[i].type)
+ return true;
+ }
+ return false;
+}
+
ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) {
for (size_t i = 0; i < arraysize(kContentSettingsTypeGroupNames); ++i) {
if (name == kContentSettingsTypeGroupNames[i].name)
@@ -67,7 +75,7 @@ std::string ContentSettingsTypeToGroupName(ContentSettingsType type) {
return kContentSettingsTypeGroupNames[i].name;
}
- NOTREACHED();
+ NOTREACHED() << type << " is not a recognized content settings type.";
return std::string();
}
« no previous file with comments | « chrome/browser/ui/webui/site_settings_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698