| Index: components/content_settings/core/browser/content_settings_info.cc
|
| diff --git a/components/content_settings/core/browser/content_settings_info.cc b/components/content_settings/core/browser/content_settings_info.cc
|
| index c111944e2860537d8a054e57ce2345cbe5dd948a..41fd1375bb032ae2c5dd471053bc6fb2f8b116d1 100644
|
| --- a/components/content_settings/core/browser/content_settings_info.cc
|
| +++ b/components/content_settings/core/browser/content_settings_info.cc
|
| @@ -5,6 +5,7 @@
|
| #include "components/content_settings/core/browser/content_settings_info.h"
|
|
|
| #include "base/stl_util.h"
|
| +#include "components/content_settings/core/browser/website_settings_info.h"
|
|
|
| namespace content_settings {
|
|
|
| @@ -24,4 +25,26 @@ bool ContentSettingsInfo::IsSettingValid(ContentSetting setting) const {
|
| return base::ContainsKey(valid_settings_, setting);
|
| }
|
|
|
| +// TODO(raymes): Find a better way to deal with the special-casing in
|
| +// IsDefaultSettingValid.
|
| +bool ContentSettingsInfo::IsDefaultSettingValid(ContentSetting setting) const {
|
| + ContentSettingsType type = website_settings_info_->type();
|
| +#if defined(OS_ANDROID) || defined(OS_CHROMEOS)
|
| + // Don't support ALLOW for protected media default setting until migration.
|
| + if (type == CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER &&
|
| + setting == CONTENT_SETTING_ALLOW) {
|
| + return false;
|
| + }
|
| +#endif
|
| +
|
| + // Don't support ALLOW for the default media settings.
|
| + if ((type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA ||
|
| + type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
|
| + setting == CONTENT_SETTING_ALLOW) {
|
| + return false;
|
| + }
|
| +
|
| + return base::ContainsKey(valid_settings_, setting);
|
| +}
|
| +
|
| } // namespace content_settings
|
|
|