Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3951)

Unified Diff: chrome/browser/android/preferences/pref_service_bridge.cc

Issue 965103004: Stop using the MEDIASTREAM content setting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase over 1004733003. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 cb5f1517f69bd78408e6bea0e484d87feb6ab8cb..f1734158a94c769092400c2d29880ad00db49b74 100644
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -445,7 +445,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);
}
@@ -551,15 +554,22 @@ static void SetAllowPopupsEnabled(JNIEnv* env, jobject obj, jboolean allow) {
}
static jboolean GetCameraMicEnabled(JNIEnv* env, jobject obj) {
- return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM);
+ return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
+ GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
}
static jboolean GetCameraMicUserModifiable(JNIEnv* env, jobject obj) {
- return IsContentSettingUserModifiable(CONTENT_SETTINGS_TYPE_MEDIASTREAM);
+ return IsContentSettingUserModifiable(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
+ IsContentSettingUserModifiable(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
}
static jboolean GetCameraMicManagedByCustodian(JNIEnv* env, jobject obj) {
- return IsContentSettingManagedByCustodian(CONTENT_SETTINGS_TYPE_MEDIASTREAM);
+ return IsContentSettingManagedByCustodian(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
+ IsContentSettingManagedByCustodian(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
}
static jboolean GetAutologinEnabled(JNIEnv* env, jobject obj) {

Powered by Google App Engine
This is Rietveld 408576698