From fedb895e32e3cc7e8898a24db72943ec2ce465de Mon Sep 17 00:00:00 2001 From: "xians@chromium.org" Date: Thu, 13 Jun 2013 16:19:31 +0000 Subject: 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 --- .../content_settings/tab_specific_content_settings.cc | 16 ++++++++++++++++ .../content_settings/tab_specific_content_settings.h | 5 +++++ 2 files changed, 21 insertions(+) (limited to 'chrome/browser/content_settings') 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); -- cgit v1.1