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

Unified Diff: chrome/renderer/content_settings_observer.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/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 9707f3da239b05b11b95e9d85dc4484cfe02da59..e88abe287df0b84e04818d1c89ec1cc4fafde2e1 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -349,6 +349,19 @@ bool ContentSettingsObserver::allowIndexedDB(const WebString& name,
return result;
}
+bool ContentSettingsObserver::allowMediaAutoplay(bool hidden) {
+ if (!content_setting_rules_)
+ return true;
+
+ WebFrame* frame = render_frame()->GetWebFrame();
+ const ContentSetting setting = GetContentSettingFromRules(
+ content_setting_rules_->media_autoplay_rules, frame,
+ GURL(frame->document().securityOrigin().toString()));
+
+ return setting == CONTENT_SETTING_ALLOW ||
+ (setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT && !hidden);
philipj_slow 2015/10/23 12:17:30 Oh... so "important content" actually means anythi
DaleCurtis 2015/10/23 19:21:27 Currently and as planned yes. There are discussion
+}
+
bool ContentSettingsObserver::allowPlugins(bool enabled_per_settings) {
return enabled_per_settings;
}

Powered by Google App Engine
This is Rietveld 408576698