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

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

Issue 1084423002: Split Camera and Mic into two permissions on the Site Details page (under Site Settings). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 5 years, 8 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 189bab02f82599e387933ff5ea45fbc2ee52fc3c..0d05ec172e361e8a309b04802b87f8b7a9570b54 100644
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -488,14 +488,19 @@ static void SetAllowLocationEnabled(JNIEnv* env,
is_enabled ? CONTENT_SETTING_ASK : CONTENT_SETTING_BLOCK);
}
-static void SetCameraMicEnabled(JNIEnv* env, jobject obj, jboolean allow) {
+static void SetCameraEnabled(JNIEnv* env, jobject obj, jboolean allow) {
HostContentSettingsMap* host_content_settings_map =
GetOriginalProfile()->GetHostContentSettingsMap();
host_content_settings_map->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
allow ? CONTENT_SETTING_ASK : CONTENT_SETTING_BLOCK);
+}
+
+static void SetMicEnabled(JNIEnv* env, jobject obj, jboolean allow) {
+ HostContentSettingsMap* host_content_settings_map =
+ GetOriginalProfile()->GetHostContentSettingsMap();
host_content_settings_map->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
allow ? CONTENT_SETTING_ASK : CONTENT_SETTING_BLOCK);
}
@@ -598,26 +603,34 @@ static void SetPasswordEchoEnabled(JNIEnv* env,
passwordEchoEnabled);
}
-
-static jboolean GetCameraMicEnabled(JNIEnv* env, jobject obj) {
- return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
- GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
+static jboolean GetCameraEnabled(JNIEnv* env, jobject obj) {
+ return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
}
-static jboolean GetCameraMicUserModifiable(JNIEnv* env, jobject obj) {
+static jboolean GetCameraUserModifiable(JNIEnv* env, jobject obj) {
return IsContentSettingUserModifiable(
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
- IsContentSettingUserModifiable(
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
}
-static jboolean GetCameraMicManagedByCustodian(JNIEnv* env, jobject obj) {
+static jboolean GetCameraManagedByCustodian(JNIEnv* env, jobject obj) {
return IsContentSettingManagedByCustodian(
- CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) &&
- IsContentSettingManagedByCustodian(
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
}
+static jboolean GetMicEnabled(JNIEnv* env, jobject obj) {
+ return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
+}
+
+static jboolean GetMicUserModifiable(JNIEnv* env, jobject obj) {
+ return IsContentSettingUserModifiable(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
+}
+
+static jboolean GetMicManagedByCustodian(JNIEnv* env, jobject obj) {
+ return IsContentSettingManagedByCustodian(
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
+}
+
static jboolean GetAutologinEnabled(JNIEnv* env, jobject obj) {
return GetPrefService()->GetBoolean(prefs::kAutologinEnabled);
}

Powered by Google App Engine
This is Rietveld 408576698