Index: chrome/browser/android/preferences/pref_service_bridge.cc |
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc |
index 4512ce62716f712add1225d5c0b96ab5da250b1a..db4c4ef3ef9348d1ed5a449fe6f65f86a8adef9b 100644 |
--- a/chrome/browser/android/preferences/pref_service_bridge.cc |
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc |
@@ -365,7 +365,10 @@ static void SetCameraMicEnabled(JNIEnv* env, jobject obj, jboolean allow) { |
HostContentSettingsMap* host_content_settings_map = |
GetOriginalProfile()->GetHostContentSettingsMap(); |
host_content_settings_map->SetDefaultContentSetting( |
- CONTENT_SETTINGS_TYPE_MEDIASTREAM, |
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, |
+ allow ? CONTENT_SETTING_ASK : CONTENT_SETTING_BLOCK); |
+ host_content_settings_map->SetDefaultContentSetting( |
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
allow ? CONTENT_SETTING_ASK : CONTENT_SETTING_BLOCK); |
} |
@@ -464,14 +467,19 @@ static void SetAllowPopupsEnabled(JNIEnv* env, jobject obj, jboolean allow) { |
static jboolean GetCameraMicEnabled(JNIEnv* env, jobject obj) { |
PrefService* prefs = GetPrefService(); |
- return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM) && |
+ return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) && |
+ GetBooleanForContentSetting( |
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) && |
prefs->GetBoolean(prefs::kAudioCaptureAllowed) && |
prefs->GetBoolean(prefs::kVideoCaptureAllowed); |
} |
static jboolean GetCameraMicUserModifiable(JNIEnv* env, jobject obj) { |
PrefService* prefs = GetPrefService(); |
- return IsContentSettingUserModifiable(CONTENT_SETTINGS_TYPE_MEDIASTREAM) && |
+ return IsContentSettingUserModifiable( |
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) && |
+ IsContentSettingUserModifiable( |
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) && |
prefs->IsUserModifiablePreference(prefs::kAudioCaptureAllowed) && |
prefs->IsUserModifiablePreference(prefs::kVideoCaptureAllowed); |
} |