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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 27635002: Content settings for <audio> and <video>. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix. Created 6 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 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 5e3edbafeb8eef2713dfa13cc85c6bdf62a4bb66..adb244d5f616ade974fd091b802aeced715143cb 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -330,6 +330,26 @@ bool ContentSettingsObserver::allowIndexedDB(const WebString& name,
return result;
}
+bool ContentSettingsObserver::allowMedia(const WebURL& media_url) {
+ if (is_interstitial_page_)
+ return true;
+
+ WebFrame* frame = render_frame()->GetWebFrame();
+ if (IsWhitelistedForContentSettings(frame))
+ return true;
+
+ bool allow = true;
+ if (content_setting_rules_) {
+ GURL secondary_url(media_url);
+ allow = GetContentSettingFromRules(
+ content_setting_rules_->media_rules,
+ frame, secondary_url) != CONTENT_SETTING_BLOCK;
+ if (!allow)
+ DidBlockContentType(CONTENT_SETTINGS_TYPE_MEDIA);
+ }
+ return allow;
+}
+
bool ContentSettingsObserver::allowPlugins(bool enabled_per_settings) {
return enabled_per_settings;
}

Powered by Google App Engine
This is Rietveld 408576698