From 6ab822eb229fcf3133e96680f284d899b64da10d Mon Sep 17 00:00:00 2001 From: knn Date: Fri, 17 Apr 2015 04:47:14 -0700 Subject: [PATCH] Re-enable content settings instead of ignoring receipt of no settings in Supervised Provider. Thus handle Sensitive Site Permissions when the child account graduates. BUG=477998 Review URL: https://codereview.chromium.org/1093813002 Cr-Commit-Position: refs/heads/master@{#325619} --- .../content_settings_supervised_provider.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/chrome/browser/content_settings/content_settings_supervised_provider.cc b/chrome/browser/content_settings/content_settings_supervised_provider.cc index b01031ca1ad3..f6294446a218 100644 --- a/chrome/browser/content_settings/content_settings_supervised_provider.cc +++ b/chrome/browser/content_settings/content_settings_supervised_provider.cc @@ -57,20 +57,20 @@ RuleIterator* SupervisedProvider::GetRuleIterator( void SupervisedProvider::OnSupervisedSettingsAvailable( const base::DictionaryValue* settings) { - if (!settings) - return; std::vector to_notify; // Entering locked scope to update content settings. { base::AutoLock auto_lock(lock_); - bool new_value, old_value; for (const auto& entry : kContentSettingsFromSupervisedSettingsMap) { - if (settings->GetBoolean(entry.setting_name, &new_value)) { - old_value = !value_map_.IsContentSettingEnabled(entry.content_type); - if (new_value != old_value) { - to_notify.push_back(entry.content_type); - value_map_.SetContentSettingDisabled(entry.content_type, new_value); - } + bool new_value = false; + if (settings && settings->HasKey(entry.setting_name)) { + bool is_bool = settings->GetBoolean(entry.setting_name, &new_value); + DCHECK(is_bool); + } + bool old_value = !value_map_.IsContentSettingEnabled(entry.content_type); + if (new_value != old_value) { + to_notify.push_back(entry.content_type); + value_map_.SetContentSettingDisabled(entry.content_type, new_value); } } } -- 2.11.4.GIT