Chromium Code Reviews| Index: chrome/browser/media/media_capture_devices_dispatcher.cc |
| diff --git a/chrome/browser/media/media_capture_devices_dispatcher.cc b/chrome/browser/media/media_capture_devices_dispatcher.cc |
| index ef6127b337e5a3a6aaec44dac7a5c4bee431a59b..c09a5b89cdbd7d2cc581cc9582303fb12acea5ab 100644 |
| --- a/chrome/browser/media/media_capture_devices_dispatcher.cc |
| +++ b/chrome/browser/media/media_capture_devices_dispatcher.cc |
| @@ -397,7 +397,13 @@ bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
| } |
| #endif |
| - if (CheckAllowAllMediaStreamContentForOrigin(profile, security_origin)) |
| + ContentSettingsType contentSettingsType = |
| + type == content::MEDIA_DEVICE_AUDIO_CAPTURE |
| + ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC |
| + : CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; |
| + |
| + if (CheckAllowAllMediaStreamContentForOrigin( |
| + profile, security_origin, contentSettingsType)) |
|
Bernhard Bauer
2015/03/09 15:45:46
Nit: If the condition spans multiple lines, it's u
msramek
2015/03/09 16:20:46
Done. Here and below.
|
| return true; |
| const char* policy_name = type == content::MEDIA_DEVICE_AUDIO_CAPTURE |
| @@ -417,9 +423,7 @@ bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
| if (profile->GetHostContentSettingsMap()->GetContentSetting( |
| security_origin, |
| security_origin, |
| - type == content::MEDIA_DEVICE_AUDIO_CAPTURE |
| - ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC |
| - : CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| + contentSettingsType, |
| NO_RESOURCE_IDENTIFIER) == CONTENT_SETTING_ALLOW) { |
| return true; |
| } |
| @@ -438,7 +442,13 @@ bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
| Profile* profile = |
| Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| - if (CheckAllowAllMediaStreamContentForOrigin(profile, security_origin)) |
| + ContentSettingsType contentSettingsType = |
| + type == content::MEDIA_DEVICE_AUDIO_CAPTURE |
| + ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC |
| + : CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; |
| + |
| + if (CheckAllowAllMediaStreamContentForOrigin( |
| + profile, security_origin, contentSettingsType)) |
| return true; |
| const char* policy_name = type == content::MEDIA_DEVICE_AUDIO_CAPTURE |
| @@ -458,9 +468,7 @@ bool MediaCaptureDevicesDispatcher::CheckMediaAccessPermission( |
| if (profile->GetHostContentSettingsMap()->GetContentSetting( |
| security_origin, |
| security_origin, |
| - type == content::MEDIA_DEVICE_AUDIO_CAPTURE |
| - ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC |
| - : CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| + contentSettingsType, |
| NO_RESOURCE_IDENTIFIER) == CONTENT_SETTING_ALLOW) { |
| return true; |
| } |