summaryrefslogtreecommitdiffstats
path: root/chrome/browser/content_settings
diff options
context:
space:
mode:
authorxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-13 16:19:31 +0000
committerxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-13 16:19:31 +0000
commitfedb895e32e3cc7e8898a24db72943ec2ce465de (patch)
treebbee9f1475051de2a7bf078d58d01e72f4d4a37a /chrome/browser/content_settings
parentc456c327f25bd17587cf8cefdc474d4db74b6313 (diff)
downloadchromium_src-fedb895e32e3cc7e8898a24db72943ec2ce465de.zip
chromium_src-fedb895e32e3cc7e8898a24db72943ec2ce465de.tar.gz
chromium_src-fedb895e32e3cc7e8898a24db72943ec2ce465de.tar.bz2
Handle microphone and camera stream access requests separately. This allows to distinguish if which stream (mic and or cam) was actually accessed.
This patch is basically doing the same things as https://codereview.chromium.org/12706018/, but it is a simplified version and won't change any of the current behaviours. BUG=172780 Review URL: https://chromiumcodereview.appspot.com/16174010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206083 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings')
-rw-r--r--chrome/browser/content_settings/tab_specific_content_settings.cc16
-rw-r--r--chrome/browser/content_settings/tab_specific_content_settings.h5
2 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 8f4e542..a663041 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -454,6 +454,22 @@ void TabSpecificContentSettings::OnMediaStreamAllowed() {
OnContentAllowed(CONTENT_SETTINGS_TYPE_MEDIASTREAM);
}
+void TabSpecificContentSettings::OnMicrophoneAccessed() {
+ OnContentAllowed(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
+}
+
+void TabSpecificContentSettings::OnMicrophoneAccessBlocked() {
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string());
+}
+
+void TabSpecificContentSettings::OnCameraAccessed() {
+ OnContentAllowed(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
+}
+
+void TabSpecificContentSettings::OnCameraAccessBlocked() {
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string());
+}
+
void TabSpecificContentSettings::ClearBlockedContentSettingsExceptForCookies() {
for (size_t i = 0; i < arraysize(content_blocked_); ++i) {
if (i == CONTENT_SETTINGS_TYPE_COOKIES)
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.h b/chrome/browser/content_settings/tab_specific_content_settings.h
index 8606d8e..14104b1 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.h
+++ b/chrome/browser/content_settings/tab_specific_content_settings.h
@@ -285,6 +285,11 @@ class TabSpecificContentSettings
// This method is called when a media stream is allowed.
void OnMediaStreamAllowed();
+ void OnMicrophoneAccessed();
+ void OnMicrophoneAccessBlocked();
+ void OnCameraAccessed();
+ void OnCameraAccessBlocked();
+
// Adds the given |SiteDataObserver|. The |observer| is notified when a
// locale shared object, like for example a cookie, is accessed.
void AddSiteDataObserver(SiteDataObserver* observer);