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

Side by Side Diff: chrome/browser/ui/webui/settings/site_settings_handler.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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/site_settings_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/settings/site_settings_handler.h" 5 #include "chrome/browser/ui/webui/settings/site_settings_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" 8 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 CallJavascriptFunction("settings.WebsiteUsagePrivateApi.onUsageCleared", 96 CallJavascriptFunction("settings.WebsiteUsagePrivateApi.onUsageCleared",
97 base::StringValue(clearing_origin_)); 97 base::StringValue(clearing_origin_));
98 } 98 }
99 } 99 }
100 100
101 void SiteSettingsHandler::OnContentSettingChanged( 101 void SiteSettingsHandler::OnContentSettingChanged(
102 const ContentSettingsPattern& primary_pattern, 102 const ContentSettingsPattern& primary_pattern,
103 const ContentSettingsPattern& secondary_pattern, 103 const ContentSettingsPattern& secondary_pattern,
104 ContentSettingsType content_type, 104 ContentSettingsType content_type,
105 std::string resource_identifier) { 105 std::string resource_identifier) {
106 if (!site_settings::HasRegisteredGroupName(content_type))
107 return;
108
106 if (primary_pattern.ToString().empty()) { 109 if (primary_pattern.ToString().empty()) {
107 CallJavascriptFunction( 110 CallJavascriptFunction(
108 "cr.webUIListenerCallback", 111 "cr.webUIListenerCallback",
109 base::StringValue("contentSettingCategoryChanged"), 112 base::StringValue("contentSettingCategoryChanged"),
110 base::StringValue(site_settings::ContentSettingsTypeToGroupName( 113 base::StringValue(site_settings::ContentSettingsTypeToGroupName(
111 content_type))); 114 content_type)));
112 } else { 115 } else {
113 CallJavascriptFunction( 116 CallJavascriptFunction(
114 "cr.webUIListenerCallback", 117 "cr.webUIListenerCallback",
115 base::StringValue("contentSettingSitePermissionChanged"), 118 base::StringValue("contentSettingSitePermissionChanged"),
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 std::string pattern_string; 291 std::string pattern_string;
289 CHECK(args->GetString(1, &pattern_string)); 292 CHECK(args->GetString(1, &pattern_string));
290 293
291 ContentSettingsPattern pattern = 294 ContentSettingsPattern pattern =
292 ContentSettingsPattern::FromString(pattern_string); 295 ContentSettingsPattern::FromString(pattern_string);
293 ResolveJavascriptCallback( 296 ResolveJavascriptCallback(
294 *callback_id, base::FundamentalValue(pattern.IsValid())); 297 *callback_id, base::FundamentalValue(pattern.IsValid()));
295 } 298 }
296 299
297 } // namespace settings 300 } // namespace settings
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/site_settings_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698