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

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: Migration code added. 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 1ba7a70bbe7e3477683a1d3fd8f3cdbd6d50e762..408f73001c4683e4f1be9fd4e661dec1612aff13 100644
--- a/chrome/browser/android/preferences/pref_service_bridge.cc
+++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -375,7 +375,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);
}
@@ -474,14 +477,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);
}

Powered by Google App Engine
This is Rietveld 408576698