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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 1414853003: Add options for audio/video autoplay to chrome://settings/content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: chrome/browser/ui/webui/options/content_settings_handler.cc
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 94be249358a55bb2804c71cc163bfb198bca207a..2d3588d38dbf6999bd39c2fe0b75f9b6216efea9 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -97,6 +97,7 @@ const ContentSettingWithExceptions kContentTypesWithExceptions[] = {
{CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, false},
{CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, false},
{CONTENT_SETTINGS_TYPE_MIDI_SYSEX, false},
+ {CONTENT_SETTINGS_TYPE_MEDIA_AUTOPLAY, false},
};
struct ContentSettingsTypeNameEntry {
@@ -150,6 +151,7 @@ const ContentSettingsTypeNameEntry kContentSettingsTypeGroupNames[] = {
{CONTENT_SETTINGS_TYPE_MIDI_SYSEX, "midi-sysex"},
{CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, "push-messaging"},
{CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, "ssl-cert-decisions"},
+ {CONTENT_SETTINGS_TYPE_MEDIA_AUTOPLAY, "media-autoplay"},
#if defined(OS_CHROMEOS)
{CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, "protectedContent"},
#endif
@@ -477,6 +479,11 @@ void ContentSettingsHandler::GetLocalizedValues(
{"pushMessagingBlock", IDS_PUSH_MESSSAGING_BLOCK_RADIO},
{"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL},
{"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON},
+ {"mediaAutoplayHeader", IDS_MEDIA_AUTOPLAY_TAB_LABEL},
+ {"mediaAutoplayAllow", IDS_MEDIA_AUTOPLAY_ALLOW_RADIO},
+ {"mediaAutoplayDetectImportantContent",
+ IDS_MEDIA_AUTOPLAY_DETECT_RECOMMENDED_RADIO},
+ {"mediaAutoplayBlock", IDS_MEDIA_AUTOPLAY_BLOCK_RADIO},
};
RegisterStrings(localized_strings, resources, arraysize(resources));
@@ -536,6 +543,8 @@ void ContentSettingsHandler::GetLocalizedValues(
IDS_MIDI_SYSEX_TAB_LABEL);
RegisterTitle(localized_strings, "zoomlevels",
IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL);
+ RegisterTitle(localized_strings, "media-autoplay",
+ IDS_MEDIA_AUTOPLAY_TAB_LABEL);
localized_strings->SetString("exceptionsLearnMoreUrl",
kExceptionsLearnMoreUrl);
@@ -1430,6 +1439,10 @@ void ContentSettingsHandler::SetContentFilter(const base::ListValue* args) {
content::RecordAction(
UserMetricsAction("Options_DefaultPushMessagingSettingChanged"));
break;
+ case CONTENT_SETTINGS_TYPE_MEDIA_AUTOPLAY:
+ content::RecordAction(
+ UserMetricsAction("Options_DefaultMediaAutoplaySettingChanged"));
+ break;
default:
break;
}

Powered by Google App Engine
This is Rietveld 408576698