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..f4e538187b3df0b10df6ac7aedbcea7a3b24cc27 100644 |
--- a/chrome/browser/media/media_capture_devices_dispatcher.cc |
+++ b/chrome/browser/media/media_capture_devices_dispatcher.cc |
@@ -397,8 +397,15 @@ 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)) { |
return true; |
+ } |
const char* policy_name = type == content::MEDIA_DEVICE_AUDIO_CAPTURE |
? prefs::kAudioCaptureAllowed |
@@ -417,9 +424,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,8 +443,15 @@ 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 |
? prefs::kAudioCaptureAllowed |
@@ -458,9 +470,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; |
} |